Code Monkey home page Code Monkey logo

learn-restructuredtext's Introduction


/RST.png

Learning ReStructuredText

I am not too experienced with ReStructuredText at the moment. This document will go over my knowledge of the ReStructuredText language so far.

This document uses the revision 8407 version of the ReStructuredText markup language.

Comments in ReStructuredText

I don't have comments down in ReStructuredText yet. I believe they are formatted like this:

	..
	This is a comment
	..
	..
	From what I know, comments need to be indented, and single line comments don't exist
	..

Break keyword in ReStructuredText

ReStructuredText does not support the break statement/keyword.

To this day, I am still not entirely sure what the break keyword does, but most languages support it.

/!\ This example has not been tested yet, and may not work

Headings in ReStructuredText

Headings in RST work like so:

=====
Document Heading (Heading 1)
=====

Heading 2
=====

Subheading (Heading 3)
-----

/!\ This example has not been tested yet, and may not work

Lists in ReStructuredText

Lists can be formed in ReStructuredText in multiple ways. The following examples showcase bullet lists, and numbered lists.

Bullet list
* Bullet list entry 1
* ReStructuredText
* Python 3
* Python 2
* Python 1
Numbered list
1. Entry 1
2. Entry 2
3. Python 3
4. Python 4?
5. HTML5

Bold in ReStructuredText

Text can be bolded in RST by doing the following:

This text is not bold

**This text is bold**

Italics in ReStructuredText

Text can be italicized in RST by doing the following:

This text is not italicized

*This text is italicized*

Code blocks in ReStructuredText

A code block can be formed in RST by doing the following:

Some Python program

``print("Hello World")``
Images in ReStructuredText

Referencing an image in ReStructuredText is very easy, and is done like so:

.. image:: Sample.svg
    :alt: Image

![Image](Sample.svg "icon")

The image is first referenced. The :alt: line is for displaying text for when the image doesn't look (most commonly, when it isn't found) then the image is referenced on the last line, and it prints it out in the document.

Horizontal Lines in ReStructuredText

Horizontal Lines/divider lines are supported in ReStructuredText. They can be defined like so:

***

Lined section

***

	..
	The lines look the same with asterisks or hyphens
	..

---

Lined section 2

---

Hyperlinks in ReStructuredText

Hyperlinks are supported in ReStructuredText. They can be defined like so:

Link1_.

.. _Link1: #footer

Footer
====

Source

The majority of my ReStructuredText knowledge comes from the official Wikipedia page it also comes from self experimentation, notably with this repository:

ReStructuredText Sandbox

Other knowledge of ReStructuredText

  1. ReStructuredText is not a curly bracket language, and also does not use semicolons at the end of each line

  2. ReStructuredText is a lighweight markup language

  3. ReStructuredText is most widely used in the Python programming community for documentation.

  4. ReStructuredText uses the .rst file extension

  5. ReStructuredText is a language recognized by GitHub, but you have to use a .gitattributes file to recognize it in the GitHub Linguist

  6. ReStructuredText is a markup language

  7. ReStructuredText can be shortened to either RST or ReST.

  8. No other knowledge of ReStructuredText at the moment.


File version: 1 (2022, Saturday, April 16th at 5:40 pm PST)


learn-restructuredtext's People

Contributors

seanpm2001 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

seanwallawalla

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.