2.2. Markdown examples (as used in documentation)#
2.2.1. SDT#
{m}`function('hello','python')`:
orfunction('hello','python')
: the{m}
gives a role that is a python function, defined here on the fly in theheader.md
, where Sphinx generates a directive a code block is then generated that allow pygments calling) A role generates a directive``` :language: matlab ```
which is then interpreted as usual.{s}`MATLAB`
forces usage of classs
(string command for SDT) in the HTML for coloring in the_static\sdt.css
: for example MATLAB.Code block
%% Step1 : Initialize model
model=struct('Node',[1 0 0 0 0 0 0; 2 0 0 0 0 0 0.15;
3 0 0 0 0.4 1.0 0.176; 4 0 0 0 0.4 0.9 0.176],...
'Elt',[],'unit','SI','name','GARTEUR');
%% Step2 Fuselage
model.Elt=feutil('ObjectBeamLine 1 2',model);
model=feutil('Extrude 0 1.0 0.0 0.0',model,...
[linspace(0,.55,5) linspace(.65,1.4,6) 1.5]);
Custom directives and roles (hello world level...)
Hello World Directive!
Hello World Role : <font color=”green”>test</font>
BlueColor custom role
2.2.2. Cross references#
https://myst-parser.readthedocs.io/en/latest/syntax/cross-referencing.html
Insert command |
Insert result |
Reference command |
Reference result |
---|---|---|---|
|
|
|
2.2.3. Tables#
Using pipes and -
a |
b |
c |
---|---|---|
\(+-\) right |
left |
center |
\( -\) right |
left |
center |
Using Jupyter :::
xxx need documentation
2.2.4. VScode shortcuts#
VSCode is now the preferred xxx
Preview side-by-side (Ctrl+K V) Install jupyter notbook support
python3
!"C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" -m pip install jupyter-book
Note that VSCode uses https://katex.org/docs/supported for default Math preview which is not yet compatible with SDT math macros.
2.2.5. Math#
Command |
Mathjax rendering |
---|---|
|
\(\ma{A}\) |
|
\(\mam{a & b \\ c & d}\) |
|
\(\vem{a & b\\c & d}\) |
|
\(\pam{a & b\\c & d}\) |
|
\(\ve{A}\) |
|
\(\pa{A}\) |
|
\(\pa{-\omega^2\ma{M}+j\omega\ma{C}+\ma{K}}\ve{x}=0\) |
|
\(\diag{A}\) |
|
\(\norm{A}\) |
|
\(\su{A}\) |
|
\(\du{A}\) |
|
\(\oft\) |
|
\(\ofw\) |
$$(my_other_label)
for jupyter
Ref to equation my_other_label
. Has failed;
Next