Skip to content

Commit

Permalink
Merge pull request #221 from lsst-sqre/tickets/DM-43617
Browse files Browse the repository at this point in the history
DM-43617: Fix Source parser for markdown not registered error for technotes
  • Loading branch information
jonathansick authored Apr 2, 2024
2 parents 0c2ea3a + 95d5eda commit 9396dcc
Show file tree
Hide file tree
Showing 11 changed files with 145 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/ci-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ jobs:
npm install
npm run build
- name: Install graphviz
run: |
sudo apt-get update
sudo apt-get install graphviz
- name: Run tests in tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python-version }}
tox-envs: "lint,typing-sphinx${{ matrix.sphinx-version }},py-test-sphinx${{ matrix.sphinx-version }}"
tox-envs: "lint,typing-sphinx${{ matrix.sphinx-version }},py-test-sphinx${{ matrix.sphinx-version }},demo"
use-cache: false

docs:
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,16 @@ jobs:
npm install
npm run build
- name: Install graphviz
run: |
sudo apt-get update
sudo apt-get install graphviz
- name: Run tox
uses: lsst-sqre/run-tox@v1
with:
python-version: ${{ matrix.python-version }}
tox-envs: 'py-test-sphinx${{ matrix.sphinx-version }},typing-sphinx${{ matrix.sphinx-version }}'
tox-envs: 'py-test-sphinx${{ matrix.sphinx-version }},typing-sphinx${{ matrix.sphinx-version }},demo'

docs:
runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

<!-- scriv-insert-here -->

<a id='changelog-1.2.1'></a>
## 1.2.1 (2024-04-02)

### Bug fixes

- Fix the "Source parser for markdown not registered" error for Markdown-based technotes. With the MyST-NB extension the Markdown parser is automatically registered, so the `documenteer.conf.technote` configuration now resets the `source_suffix` configuration originally created by the Technote package.

<a id='changelog-1.2.0'></a>
## 1.2.0 (2024-03-26)

Expand Down
2 changes: 2 additions & 0 deletions demo/md-technote/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_build
.technote
3 changes: 3 additions & 0 deletions demo/md-technote/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.PHONY:
clean:
rm -rf _build
1 change: 1 addition & 0 deletions demo/md-technote/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from documenteer.conf.technote import * # noqa F401 F403
14 changes: 14 additions & 0 deletions demo/md-technote/diagram.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from diagrams.k8s.clusterconfig import HPA
from diagrams.k8s.compute import Deployment, Pod, ReplicaSet
from diagrams.k8s.network import Ingress, Service
from sphinx_diagrams import SphinxDiagram

with SphinxDiagram(title="GKE"):
net = Ingress("domain.com") >> Service("svc")
(
net
>> [Pod("pod1"), Pod("pod2"), Pod("pod3")]
<< ReplicaSet("rs")
<< Deployment("dp")
<< HPA("hpa")
)
73 changes: 73 additions & 0 deletions demo/md-technote/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Demo technote

```{abstract}
A *technote* is a web-native single page document that enables rapid technical communication within and across teams.
```

## Introduction

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

A parenthetical citation {cite:p}`2017arXiv170309824V`. And a textual citation {cite:t}`2017arXiv170309824V`.

## Method

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

A list:

- First item
- Second item
- Third item

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

```{code-block} python
:caption: hello.py
print("Hello world")
```

## Results

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

### Subsection

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

#### Subsubsection

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

## Analysis

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

```{prompt} bash
git add index.rst
```

Some following text.

```{mermaid}
graph TD
A[Square Rect] -- Link text --> B((Circle))
A --> C(Round Rect)
B --> D{Rhombus}
C --> D
```

```{diagrams} diagram.py
```

## Conclusion

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin facilisis pharetra neque, at semper nulla mattis auctor. Proin semper mollis enim eget interdum. Mauris eleifend eget diam vitae bibendum. Praesent ut aliquet odio, sodales imperdiet nisi. Nam interdum imperdiet tortor sed fringilla. Maecenas efficitur mi sodales nulla commodo rutrum. Ut ornare diam quam, sed commodo turpis aliquam et. In nec enim consequat, suscipit tortor sit amet, luctus ante. Integer dictum augue diam, non pulvinar massa euismod in. Morbi viverra condimentum auctor. Nullam et metus mauris. Cras risus ex, porta sit amet nibh et, dapibus auctor leo.

## References

```{bibliography}
```
25 changes: 25 additions & 0 deletions demo/md-technote/technote.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[technote]
id = "SQR-000"
series_id = "SQR"
canonical_url = "https://sqr-000.lsst.io"
github_url = "https://github.com/lsst-sqre/sqr-000"
github_default_branch = "master"
date_created = 2015-11-18
date_updated = 2015-11-23
version = "1.0.0"

[[technote.authors]]
name.given = "Jonathan"
name.family = "Sick"
orcid = "https://orcid.org/0000-0003-3001-676X"
affiliations = [
{ name = "Rubin Observatory", ror = "https://ror.org/048g3cy84" }
]

[[technote.authors]]
name.given = "Frossie"
name.family = "Economou"

[[technote.authors]]
name.given = "Russ"
name.family = "Allbery"
6 changes: 6 additions & 0 deletions src/documenteer/conf/technote.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
]
)

# The source file suffixes for .md and .ipynb are automatically managed by
# myst-nb.
source_suffix = {
".rst": "restructuredtext",
}

html_static_path: list[str] = [
get_asset_path("rubin-favicon-transparent-32px.png"),
get_asset_path("rubin-favicon.svg"),
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,7 @@ allowlist_externals =
commands =
rm -rf demo/rst-technote/_build
sphinx-build --keep-going -n -W -T -b html -d {envtmpdir}/doctrees demo/rst-technote demo/rst-technote/_build/html
rm -rf demo/md-technote/_build
sphinx-build --keep-going -n -W -T -b html -d {envtmpdir}/doctrees demo/md-technote demo/md-technote/_build/html
rm -rf demo/ipynb-technote/_build
sphinx-build --keep-going -n -W -T -b html -d {envtmpdir}/doctrees demo/ipynb-technote demo/ipynb-technote/_build/html

0 comments on commit 9396dcc

Please sign in to comment.