Skip to content

Commit

Permalink
Add "markdown_bullet" config
Browse files Browse the repository at this point in the history
Signed-off-by: Liran Funaro <[email protected]>
  • Loading branch information
liran-funaro committed Jan 12, 2025
1 parent 71a666c commit 81ccbda
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ You can add the following configurations to your `conf.py` file:
* `markdown_docinfo`: Adds metadata to the top of each document containing author, copyright, and version.
* `markdown_http_base`: If set, all references will link to this prefix address
* `markdown_uri_doc_suffix`: If set, all references will link to documents with this suffix.
* `markdown_bullet`: Sets the bullet marker.

For example, if your `conf.py` file have the following configuration:

```python
markdown_http_base = "https://your-domain.com/docs"
markdown_uri_doc_suffix = ".html"
markdown_bullet = "*"
```

Then a reference to `your-doc-name#your-header` will be substituted with `https://your-domain.com/docs/your-doc-name.html#your-header`.
Expand Down
11 changes: 6 additions & 5 deletions sphinx_markdown_builder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@

def setup(app):
app.add_builder(MarkdownBuilder)
app.add_config_value("markdown_http_base", "", False)
app.add_config_value("markdown_uri_doc_suffix", ".md", False)
app.add_config_value("markdown_anchor_sections", False, False)
app.add_config_value("markdown_anchor_signatures", False, False)
app.add_config_value("markdown_docinfo", False, False)
app.add_config_value("markdown_http_base", "", "html")
app.add_config_value("markdown_uri_doc_suffix", ".md", "html")
app.add_config_value("markdown_anchor_sections", False, "html")
app.add_config_value("markdown_anchor_signatures", False, "html")
app.add_config_value("markdown_docinfo", False, "html")
app.add_config_value("markdown_bullet", "*", "html")
2 changes: 1 addition & 1 deletion sphinx_markdown_builder/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ def visit_enumerated_list(self, _node):
depart_enumerated_list = _end_list

def visit_bullet_list(self, node):
self._start_list(node.attributes.get("bullet", "*"))
self._start_list(node.attributes.get("bullet", self.config.markdown_bullet))

depart_bullet_list = _end_list
visit_list_item = _start_list_item
Expand Down

0 comments on commit 81ccbda

Please sign in to comment.