diff --git a/docs/_doxygen/Doxyfile b/docs/_doxygen/Doxyfile index 6493f93..da93e14 100644 --- a/docs/_doxygen/Doxyfile +++ b/docs/_doxygen/Doxyfile @@ -1123,7 +1123,8 @@ IMAGE_PATH = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = +# INPUT_FILTER = "sed -re 's/\/\/[[:space:]]*(TODO|FIXME|XXX):?/\/\/\/ @todo/g'" # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the diff --git a/docs/conf.py b/docs/conf.py index 8b86ece..b19dac4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -106,3 +106,10 @@ def setup(app): # -- Images ------------------------------------------------------------------ extensions.append("sphinxcontrib.images") + +# -- Custom extensions ------------------------------------------------------- +import sys + +sys.path.append("./extensions/") + +extensions.append("todos") diff --git a/docs/contributing/index.rst b/docs/contributing/index.rst new file mode 100644 index 0000000..69d84af --- /dev/null +++ b/docs/contributing/index.rst @@ -0,0 +1,8 @@ +:octicon:`bug` Допомогти в розробці +=================================== + +.. toctree:: + :maxdepth: 1 + + reporting + todos diff --git a/docs/contributing/reporting.rst b/docs/contributing/reporting.rst new file mode 100644 index 0000000..414fd6e --- /dev/null +++ b/docs/contributing/reporting.rst @@ -0,0 +1,4 @@ +Повідомити про помилку +====================== + +Якщо ви знайшли помилку, `створіть Issue в нашому репозиторії на GitHub `_. diff --git a/docs/contributing/todos.rst b/docs/contributing/todos.rst new file mode 100644 index 0000000..923e790 --- /dev/null +++ b/docs/contributing/todos.rst @@ -0,0 +1,6 @@ +Перелік невирішених проблем в коді +================================== + +.. todos:: ../ + :include-ext: .c,.cpp,.h + :exclude-dirs: .ccls-cache,.pio,doomgeneric,bak,mJS,SimpleFTPServer diff --git a/docs/extensions/.gitignore b/docs/extensions/.gitignore new file mode 100644 index 0000000..45d55a0 --- /dev/null +++ b/docs/extensions/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +*.py[co] diff --git a/docs/extensions/todos.py b/docs/extensions/todos.py new file mode 100644 index 0000000..90c38f8 --- /dev/null +++ b/docs/extensions/todos.py @@ -0,0 +1,69 @@ +import os + +from docutils import nodes +from docutils.parsers.rst import Directive + + +class ToDoExtractor(Directive): + has_content = True + option_spec = { + "include-ext": lambda x: x.lower().split(","), + "exclude-dirs": lambda x: x.split(","), + } + + def run(self): + # Get directory from which we want to extract todos + directory = self.content[0] + + # Search all .c/.cpp/.h files in the directory recursively + + root_node = nodes.bullet_list() + + for root, dirs, files in os.walk(directory): + if self.options.get("exclude-dirs"): + if any( + exclude_dir in root for exclude_dir in self.options["exclude-dirs"] + ): + continue + for file in files: + full_path = os.path.join(root, file) + clean_path = full_path.removeprefix("../") + if self.options.get("include-ext") and not file.lower().endswith( + tuple(self.options["include-ext"]) + ): + continue + with open(os.path.join(root, file)) as f: + lines = f.readlines() + for lineno, line in enumerate(lines, 1): + if "TODO" in line: + # Create a list item + list_node = nodes.list_item() + # Add link to "https://github.com/and3rson/lilka/blob/main/{clean_path}" + filename_para = nodes.paragraph() + filename_para += nodes.reference( + rawsource=f"{clean_path}:{lineno}", + text=f"{clean_path}:{lineno}", + refuri=f"https://github.com/and3rson/lilka/blob/main/{clean_path}#L{lineno}", + ) + list_node += filename_para + # Add content as code block with C/C++ syntax highlighting + content_para = nodes.paragraph() + # Get this line and previous/next lines + text = ''.join(lines[lineno - 2 : lineno + 1]) + code = nodes.literal_block(text, text) + code["language"] = "cpp" + content_para += code + list_node += content_para + root_node += list_node + + return [root_node] + + +def setup(app): + app.add_directive("todos", ToDoExtractor) + + return { + "version": "0.1", + "parallel_read_safe": True, + "parallel_write_safe": True, + } diff --git a/docs/index.rst b/docs/index.rst index 9ffa2bc..bba383b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -21,6 +21,7 @@ faq/index glossary community + contributing/index .. .. sidebar-links:: .. :caption: Посилання: diff --git a/sdk/lib/lilka/src/lilka/buzzer.h b/sdk/lib/lilka/src/lilka/buzzer.h index 9507f3c..7ecc905 100644 --- a/sdk/lib/lilka/src/lilka/buzzer.h +++ b/sdk/lib/lilka/src/lilka/buzzer.h @@ -35,6 +35,7 @@ typedef struct { /// - 2 - половина /// - 4 - чверть /// - 8 - одна восьма + /// /// і т.д. /// /// Від'ємне значення - це ноти з крапкою: @@ -42,6 +43,7 @@ typedef struct { /// - -2 - половина з крапкою (1/2 + 1/4) /// - -4 - чверть з крапкою (1/4 + 1/8) /// - -8 - одна восьма з крапкою (1/8 + 1/16) + /// /// і т.д. int8_t size; } Tone; diff --git a/sdk/lib/lilka/src/lilka/inputdialog.cpp b/sdk/lib/lilka/src/lilka/inputdialog.cpp index 17c729a..87e9664 100644 --- a/sdk/lib/lilka/src/lilka/inputdialog.cpp +++ b/sdk/lib/lilka/src/lilka/inputdialog.cpp @@ -72,7 +72,7 @@ void InputDialog::update() { State state = controller.getState(); if (state.a.justPressed) { - // \todo Handle key press + // TODO: Handle key press const uint8_t* layerKeys = keyboard[layer]; uint8_t key = layerKeys[cy * LILKA_KB_COLS + cx]; if (key == K_L0) {