Skip to content

Commit d8baa52

Browse files
committed
update README and docs
1 parent 586c974 commit d8baa52

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ extensions = [
3131
]
3232

3333
# -------------------------- Optional Configuration --------------------------
34-
# 1. Specify math engine (default: "mathjax3", alternative: "katex")
35-
pseudocode2_math_engine = "mathjax3"
34+
# 1. Specify math engine (default: "katex", alternative: "mathjax3")
35+
pseudocode2_math_engine = "katex"
3636

3737
# 2. Global pseudocode.js configuration (pseudocode2_options)
3838
# All parameters are directly passed to pseudocode.renderClass()

docs/source/index.rst

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,31 @@ Pseudocode rendering is extended with practical options (all compatible with pse
5555
- ``scopelines``: Highlight scope lines (those with control block starters like IF, FOR, WHILE, etc.)
5656
- ``no-scopelines``: Disable scope line highlighting
5757

58+
Typical usage example:
59+
60+
.. code-block:: rst
61+
62+
.. pcode::
63+
:linenos:
64+
:indent: 1.5em
65+
:comment-delimiter: "#"
66+
:line-number-punc: " | "
67+
:no-end:
68+
:title-prefix: "PseudoCode"
69+
:scopelines:
70+
71+
\begin{algorithm}
72+
\caption{My Sample Algorithm}
73+
\begin{algorithmic}
74+
\STATE Initialize variables
75+
\FOR{each item in list}
76+
\IF{item is valid}
77+
\STATE Process item # This is a comment
78+
\ENDIF
79+
\ENDFOR
80+
\end{algorithmic}
81+
\end{algorithm}
82+
5883
Global Configuration via ``pseudocode2_options``
5984
=====================================================
6085

@@ -74,6 +99,12 @@ Pseudocode rendering styles can be unified across the entire project using a sin
7499
**Priority Rule**:
75100
Configuration priority (higher priority overrides lower): Directive option (e.g., :linenos: in .rst) > pseudocode2_options (global in conf.py) > pseudocode.js default
76101

102+
Another configurable option is ``pseudocode2_math_engine`` (set in `conf.py`), which specifies the math rendering engine to use (either ``"katex"`` or ``"mathjax3"``; default is ``"katex"``):
103+
104+
.. code-block:: python
105+
106+
pseudocode2_math_engine = "katex" # or "mathjax3"
107+
77108
Tips
78109
=====================================================
79110

0 commit comments

Comments
 (0)