Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getnikola/plugins
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2ec003ab5579
Choose a base ref
...
head repository: getnikola/plugins
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 553e2d072176
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Jul 2, 2015

  1. Copy the full SHA
    165dbe8 View commit details
  2. Copy the full SHA
    553e2d0 View commit details
Showing with 612 additions and 4 deletions.
  1. +1 −4 v7/emoji/emoji.py
  2. +59 −0 v7/sphinx_roles/README.md
  3. +13 −0 v7/sphinx_roles/sphinx_roles.plugin
  4. +539 −0 v7/sphinx_roles/sphinx_roles.py
5 changes: 1 addition & 4 deletions v7/emoji/emoji.py
Original file line number Diff line number Diff line change
@@ -38,10 +38,7 @@ class Plugin(RestExtension):
def set_site(self, site):
self.site = site
roles.register_local_role('emoji', emoji_role)
if hasattr(site, 'transforms'):
site.transforms.append(Emojis)
else:
site.transforms = [Emojis]
site.rst_transforms.append(Emojis)


def emoji_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
59 changes: 59 additions & 0 deletions v7/sphinx_roles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
This plugin adds reStructuredText roles and directives for Sphinx compatibility.

Currently supported:

* **pep:** An enhanced `:pep:` role with support for anchors, like Sphinx's
* **ref:** Cross references for arbitrary locations (see [the sphinx docs](http://sphinx-doc.org/markup/inline.html#role-ref)). Limited to links inside a single document.
* **rfc:** An enhanced `:rfc:` role with support for anchors, like Sphinx's
* **term:** Reference to a term in the glossary
* **term:** Reference to a option defined using the option directive

The following are "semantic markup", they produce a HTML element with an extra
CSS class for styling. The description is from the Sphinx docs.

* **abbr**: abbreviations with explanations
* **command:** The name of an OS-level command, such as ``rm``
* **dfn:** Mark the defining instance of a term in the text. (No index entries are generated.) [Remember Nikola has no indexes anyway]
* **kbd:** Mark a sequence of keystrokes.
* **mailheader:** The name of an RFC 822-style mail header.
* **makevar:** The name of a make variable.
* **manpage:** A reference to a Unix manual page including the section.
* **mimetype:** The name of a MIME type, or a component of a MIME type (the major or minor portion, taken alone).
* **newsgroup:** The name of a Usenet newsgroup.
* **program:** The name of an executable program.
* **regexp:** A regular expression. Quotes should not be included.
* **samp:** A piece of literal text, such as code. Within the contents, you can use curly braces to indicate a “variable” part.
* **file:** The name of a file or directory. Within the contents, you can use curly braces to indicate a “variable” part
* **menuselection:** Menu selections should be marked using the menuselection role. This is used to mark a complete sequence of menu selections, including selecting submenus and choosing a specific operation, or any subsequence of such a sequence. The names of individual selections should be separated by -->.
* **guilabel:** Labels presented as part of an interactive user interface should be marked using guilabel.

This plugin also implementes Sphinx's [extlinks extension](http://sphinx-doc.org/latest/ext/extlinks.html)
which lets you create "shortcuts" to URLs that follow a pattern. You need to declare the patterns
in `conf.py`:

```
EXTLINKS = {'issue': ('https://bitbucket.org/birkenfeld/sphinx/issue/%s',
'issue ')}
```

Which will create this link [issue 123](https://bitbucket.org/birkenfeld/sphinx/issue/123) out of this:

```
:issue:`123`
```

For more details see [the sphinx docs for extlinks.](http://sphinx-doc.org/latest/ext/extlinks.html)

It also implements the following [paragraph-level markup from Sphinx](http://sphinx-doc.org/markup/para.html):

* **versionadded**
* **versionchanged**
* **deprecated**
* **centered**
* **hlist** -- Needs the user to define a hlist class in CSS that removes table borders to look good.
* **seealso** -- Needs the user to define a seealso class in CSS to change the look of the admonition.

And finally, there is limited support for:

* **glossary** -- Partially implemented: the term role only works in the same file as the glossary, and it doesn't support multiple terms per definition.
* **option** -- Flaky, links from the option role don't work across files.
13 changes: 13 additions & 0 deletions v7/sphinx_roles/sphinx_roles.plugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Core]
Name = sphinx_roles
Module = sphinx_roles

[Nikola]
MinVersion = 7.4.0

[Documentation]
Author = Roberto Alsina
Version = 0.3
Website = http://plugins.getnikola.com/#sphinx_roles
Description = A set of reStructuredText roles for Sphinx compatibility

Loading