当前位置:网站首页>Sphinx supplement

Sphinx supplement

2020-12-07 13:01:28 The clouds are deep and boundless

https://blog.csdn.net/enjoyyl/article/details/97820201
http://www.latextemplates.com/svgnames-colors
https://woodenrobot.me/
https://zh-sphinx-doc.readthedocs.io/en/latest/tutorial.html
https://zh-sphinx-doc.readthedocs.io/en/latest/rest.html
https://docs.readthedocs.io/en/stable/webhooks.html
https://zh-sphinx-doc.readthedocs.io/en/latest/rest.html

My writing habit is to send out the reference materials directly , There may be a sense of fragmentation in reading . But in the sense of learning , from the shallower to the deeper , From the shallow to the deep , All of the following articles are like this ........


I'm talking about it Sphinx It's a tool , A set of reStructuredText Source file Convert to various output formats , Automatically generate cross references , Index, etc. . in other words , If your directory contains a bunch of reST The format of the document ( There may also be subdirectories for documents ) as well as ),Sphinx It can generate well structured HTML file ( In other directories ), To facilitate browsing and navigation . But from the same source , It can also generate LaTeX file , It can also be compiled into a PDF edition , Or use it directly rst2pdf Compiled into PDF file .

When you use vscode Open one rst When you file , This plug-in will be recommended , Written by Japanese brother

https://github.com/shuGH/vscode-table-formatter
.. yunswj documentation master file, created by
   sphinx-quickstart on Wed Dec  2 15:31:20 2020.
   You can adapt this file completely to your liking, but it should at least
   contain the root `toctree` directive.

Welcome to yunswj's documentation!
==================================

.. toctree::
   :maxdepth: 2
   :caption: Contents:



Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

This is the document , In fact, this document can also be txt file . But I wrote rst, What's the matter

Just like this.


On the command palette (Ctrl-Shift-P or Cmd-Shift-P) Enter command in , The cursor position is used in the table syntax . The current table will be formatted . perhaps , You can format all table syntax as open text . At that time , The markup language is determined automatically .

Command title :

  • Table: Format Current
    • Format a table method that contains only the current cursor position
    • command : extension.table.formatCurrent
  • Table: Format All
    • Format all table syntax as open text
    • command : extension.table.formatAll

Same as the document says

It's comfortable to have automatic completion

One reStructuredText Tag element , It can tag content blocks with special meanings . Instructions are not only provided by docutils Provide , and Sphinx And custom extensions can add their own instructions . The basic instruction syntax is shown below :

.. Instruction names :: Parameters ...
   :option: value 

    The content of the instruction .

To be in LaTeX Use these colors in the document , just \usepackage[svgnames]{xcolor} Add color to your prologue , And then use \color{} command ( for example \color{Navy}) Choose a color , After that, all the text will be the color you specify .

It's a bit out of line ,latex It is a consensus in the academic circles , I'll talk about this later . If I write a paper .

https://sphinx-doc-zh.readthedocs.io/en/latest/config.html#build-config

Basic configuration

As mentioned earlier, we use conf.py Script to control Sphinx How to deal with documents . Actually, it's standard Python Script , For advanced users : You can embed your own special tasks , such as : change sys.path, Or import another module to automatically explore the current version of the document .

Related configuration items have been created by sphinx-quickstart Write on initialization conf.py ( Use Py Standard notes for # Add some alternatives , It's annotated in advance ) To revise the corresponding configuration , Just remove the comments on the corresponding line first , And revise the parameter value . You want to add custom parameters , If not sphinx-quickstart Generated in advance , I'll add it by myself .

Be careful , Keep configuration files strictly used Python Script Syntax , especially String , Numbers , List, etc . And the default file is UTF-0 Code saved , Declared on the first line . If there is a parameter value, use not ASCII String , You have to use Python Of Unicode Formal declaration (project = u'Exposé')

Source directory * stay :term:` Resource directory ` ,* Compile Directory Is the target directory we specified for the expected compilation output . -b Option to select a compiler ; The current instance Sphnix The output will be compiled HTML file .

Actually sphinx-quickstart The script has been created Makefile as well as make.bat It makes it easier for us to compile at any time , as long as

$ make html

This one is quite miscellaneous , A supplement to the above article . Specifically, this article also has a grammar , Be able to speak reStructuredText as well as MarkDown. There will be a short example ~

This article is from WeChat official account. - The cloud is deep and traceless (TT1827652464) , author : The cloud is deep and traceless

The source and reprint of the original text are detailed in the text , If there is any infringement , Please contact the yunjia_community@tencent.com Delete .

Original publication time : 2020-12-02

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[The clouds are deep and boundless]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/12/20201207125830427f.html