Skip to content

Commit

Permalink
doc: add contributing page
Browse files Browse the repository at this point in the history
  • Loading branch information
and3rson committed Jul 27, 2024
1 parent 8040912 commit e45813e
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docs/_doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,10 @@ def setup(app):

# -- Images ------------------------------------------------------------------
extensions.append("sphinxcontrib.images")

# -- Custom extensions -------------------------------------------------------
import sys

sys.path.append("./extensions/")

extensions.append("todos")
8 changes: 8 additions & 0 deletions docs/contributing/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
:octicon:`bug` Допомогти в розробці
===================================

.. toctree::
:maxdepth: 1

reporting
todos
4 changes: 4 additions & 0 deletions docs/contributing/reporting.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Повідомити про помилку
======================

Якщо ви знайшли помилку, `створіть Issue в нашому репозиторії на GitHub <https://github.com/and3rson/lilka/issues/new>`_.
6 changes: 6 additions & 0 deletions docs/contributing/todos.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Перелік невирішених проблем в коді
==================================

.. todos:: ../
:include-ext: .c,.cpp,.h
:exclude-dirs: .ccls-cache,.pio,doomgeneric,bak,mJS,SimpleFTPServer
2 changes: 2 additions & 0 deletions docs/extensions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__
*.py[co]
69 changes: 69 additions & 0 deletions docs/extensions/todos.py
Original file line number Diff line number Diff line change
@@ -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,
}
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
faq/index
glossary
community
contributing/index

.. .. sidebar-links::
.. :caption: Посилання:
Expand Down
2 changes: 2 additions & 0 deletions sdk/lib/lilka/src/lilka/buzzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ typedef struct {
/// - 2 - половина
/// - 4 - чверть
/// - 8 - одна восьма
///
/// і т.д.
///
/// Від'ємне значення - це ноти з крапкою:
/// - -1 - ціла нота з крапкою (1 + 1/2)
/// - -2 - половина з крапкою (1/2 + 1/4)
/// - -4 - чверть з крапкою (1/4 + 1/8)
/// - -8 - одна восьма з крапкою (1/8 + 1/16)
///
/// і т.д.
int8_t size;
} Tone;
Expand Down
2 changes: 1 addition & 1 deletion sdk/lib/lilka/src/lilka/inputdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e45813e

Please sign in to comment.