Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Add translations linking
Browse files Browse the repository at this point in the history
  • Loading branch information
ntrrg committed Mar 21, 2018
1 parent eb135c8 commit 893301a
Show file tree
Hide file tree
Showing 20 changed files with 347 additions and 101 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

[Unreleased]: https://github.com/ntrrg/NtDocutils/compare/v0.2.1...HEAD
[Unreleased]: https://github.com/ntrrg/NtDocutils/compare/v0.2.2...HEAD
## [Unreleased][]

[0.2.2]: https://github.com/ntrrg/NtDocutils/compare/v0.2.1...v0.2.2
## [0.2.2][]

### Added

* Translations linking

[0.2.1]: https://github.com/ntrrg/NtDocutils/compare/v0.2.0...v0.2.1
## [0.2.1][]

Expand Down
6 changes: 3 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[0.2.1]: https://github.com/ntrrg/NtDocutils/releases/tag/v0.2.1
# News ([0.2.1][])
[0.2.2]: https://github.com/ntrrg/NtDocutils/releases/tag/v0.2.2
# News ([0.2.2][])

* Responsive classes for MDL theme (`small-screen` and `large-screen`)
* Translations linking
14 changes: 8 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

.. image:: https://img.shields.io/badge/license-MIT-blue.svg
:alt: License
:target: https://github.com/ntrrg/NtDocutils/blob/v0.2.1/LICENSE
:target: https://github.com/ntrrg/NtDocutils/blob/v0.2.2/LICENSE

__ https://getmdl.io/

Expand All @@ -26,7 +26,9 @@ Features
* Filter content by OS, distributions, categories or any other filters you
want.

* Attachments, print friendly and more.
* Attachments, print, translations linking and more.

* Print friendly and responsiveness.

* Theme customization.

Expand All @@ -44,22 +46,22 @@ From PyPI

.. code:: sh
pip install NtDocutils==0.2.1
pip install NtDocutils==0.2.2
From source
-----------

.. code:: sh
wget -c 'https://github.com/ntrrg/NtDocutils/archive/v0.2.1.tar.gz'
wget -c 'https://github.com/ntrrg/NtDocutils/archive/v0.2.2.tar.gz'
.. code:: sh
tar -xvf NtDocutils-0.2.1.tar.gz
tar -xvf NtDocutils-0.2.2.tar.gz
.. code:: sh
cd NtDocutils-0.2.1
cd NtDocutils-0.2.2
.. code:: sh
Expand Down
118 changes: 98 additions & 20 deletions docs/NtDocutils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ NtDocutils
==========

-----
0.2.1
0.2.2
-----

:Author: Miguel Angel Rivera Notararigo
:Contact: ntrrgx@gmail.com
:Date: 2018-03-17 21:00:00 -04:00
:License: `MIT <https://github.com/ntrrg/NtDocutils/blob/v0.2.1/LICENSE>`_
:Date: 2018-03-21 03:18:00 -04:00
:License: `MIT <https://github.com/ntrrg/NtDocutils/blob/v0.2.2/LICENSE>`_

.. image:: images/ntdocutils.png
:class: article-image
Expand Down Expand Up @@ -49,16 +49,20 @@ __ `Filtering`_
want (see `this section`__).

__ Attachments_
__ Printing_
__ Responsiveness_
__ Translations_

.. |options-button| image:: images/options-button.png
:class: inline
:height: 3em

* Attachments (see `this section`__), print friendly (see `this section`__),
responsiveness (see `this section`__) and more from the |options-button|
button.
* Attachments (see `this section`__), print, translations linking (see `this
section`__) and more from the |options-button| button.

__ Printing_
__ Responsiveness_

* Print friendly (see `this section`__) and responsiveness (see `this
section`__).

__ `Theme customization`_

Expand All @@ -84,12 +88,12 @@ From PyPI
.. code:: sh
:class: fl fl-debian
pip install NtDocutils==0.2.1
pip install NtDocutils==0.2.2
.. code:: bat
:class: fl fl-windows
pip install NtDocutils==0.2.1
pip install NtDocutils==0.2.2
From source
-----------
Expand All @@ -98,15 +102,15 @@ From source

.. code:: sh
wget -c 'https://github.com/ntrrg/NtDocutils/archive/v0.2.1.tar.gz'
wget -c 'https://github.com/ntrrg/NtDocutils/archive/v0.2.2.tar.gz'
.. code:: sh
tar -xvf NtDocutils-0.2.1.tar.gz
tar -xvf NtDocutils-0.2.2.tar.gz
.. code:: sh
cd NtDocutils-0.2.1
cd NtDocutils-0.2.2
.. code:: sh
Expand All @@ -115,12 +119,12 @@ From source
.. class:: fl fl-windows

Download an extract the file
https://github.com/ntrrg/NtDocutils/archive/v0.2.1.tar.gz, then run the
https://github.com/ntrrg/NtDocutils/archive/v0.2.2.tar.gz, then run the
following commands:

.. code:: bat
cd NtDocutils-0.2.1
cd NtDocutils-0.2.2
.. code:: bat
Expand Down Expand Up @@ -226,7 +230,7 @@ adding the following lines in the article:
ATTACHMENTS = [
{
url: 'NtDocutils.rst',
name: 'NtDocutils 0.2.1.rst',
name: 'NtDocutils 0.2.2.rst',
icon: 'code'
}
];
Expand Down Expand Up @@ -273,6 +277,62 @@ adding the following lines in the article:
];
</script>
Translations
------------

.. |lang-button| image:: images/lang-button.png
:class: inline
:height: 3em

You can link article translations in the |lang-button| button by adding the
following lines in the article:

.. code:: rest
:number-lines:
.. raw:: html
<script>
LANGS = [
{
url: '/es',
name: 'Spanish (Español)'
}
];
</script>
.. admonition:: Syntax
:class: syntax

``LANGS`` is a global array, it store the translations list showed in the
|lang-button| button, each translation must be defined as an object with
the following properties:

``url`` (string)
URL to the translation page, could be an external link.

``name`` (string)
Name displayed at the list.

.. code:: text
:number-lines:
.. raw:: html
<script>
LANGS = [
{
"url": URL,
"name": DISPLAY_NAME
},
...
{
"url": URL_N,
"name": DISPLAY_NAME_N
}
];
</script>
Printing
--------

Expand Down Expand Up @@ -340,6 +400,22 @@ you want it work, try it, resize the window.
# SMALL SCREEN DETECTED! #
##########################
.. code:: rst
.. code:: text
:class: large-screen
##########################
# LARGE SCREEN DETECTED! #
##########################
.. code:: text
:class: small-screen
##########################
# SMALL SCREEN DETECTED! #
##########################
Theme customization
-------------------

Expand Down Expand Up @@ -443,10 +519,12 @@ Should be enough with this:
Contributing
============

__ https://github.com/ntrrg/NtDocutils/blob/v0.2.1/CONTRIBUTING.md
__ https://github.com/ntrrg/NtDocutils/blob/v0.2.2/CONTRIBUTING.md

See the `contribution guide`__ for more information.

|pb|

Acknowledgment
==============

Expand Down Expand Up @@ -494,16 +572,16 @@ Working on this project I use/used:
ATTACHMENTS = [
{
url: 'NtDocutils.rst',
name: 'NtDocutils 0.2.1.rst',
name: 'NtDocutils 0.2.2.rst',
icon: 'code'
},
{
url: 'attachments/ntdocutils_debian.pdf',
name: 'NtDocutils 0.2.1 (Debian).pdf'
name: 'NtDocutils 0.2.2 (Debian).pdf'
},
{
url: 'attachments/ntdocutils_windows.pdf',
name: 'NtDocutils 0.2.1 (Windows).pdf'
name: 'NtDocutils 0.2.2 (Windows).pdf'
}
];
</script>
Expand Down
Binary file modified docs/attachments/demo.pdf
Binary file not shown.
Binary file modified docs/attachments/ntdocutils_debian.pdf
Binary file not shown.
Binary file modified docs/attachments/ntdocutils_windows.pdf
Binary file not shown.
20 changes: 13 additions & 7 deletions docs/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@

</style>

<link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.1/ntdocutils/themes/mdl/css/minimal.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.1/ntdocutils/themes/mdl/css/plain.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.1/ntdocutils/themes/mdl/css/ntdocutils.min.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.1/ntdocutils/themes/mdl/css/paraiso-light.min.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.1/ntdocutils/themes/mdl/css/paraiso-dark.min.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.1/ntdocutils/themes/mdl/css/print.min.css' />
<link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.2/ntdocutils/themes/mdl/css/minimal.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.2/ntdocutils/themes/mdl/css/plain.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.2/ntdocutils/themes/mdl/css/ntdocutils.min.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.2/ntdocutils/themes/mdl/css/paraiso-light.min.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.2/ntdocutils/themes/mdl/css/paraiso-dark.min.css' /><link rel='stylesheet' href='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.2/ntdocutils/themes/mdl/css/print.min.css' />

</head>
<body>
Expand Down Expand Up @@ -459,11 +459,11 @@ <h1 class="title">NtDocutils demo</h1>
</pre>
</dd>
<dt class="version">Version</dt>
<dd class="version">0.2.1</dd>
<dd class="version">0.2.2</dd>
<dt class="date">Date</dt>
<dd class="date">2018-03-17 21:20:00 -04:00</dd>
<dt class="license">License</dt>
<dd class="license"><p><a class="reference external" href="https://github.com/ntrrg/NtDocutils/blob/v0.2.1/LICENSE">MIT</a></p>
<dd class="license"><p><a class="reference external" href="https://github.com/ntrrg/NtDocutils/blob/v0.2.2/LICENSE">MIT</a></p>
</dd>
</dl>
<img alt="NtDocutils" class="article-image" src="images/ntdocutils.png" />
Expand Down Expand Up @@ -1025,12 +1025,12 @@ <h2><a class="toc-backref" href="#id46">Block syntax highlighting</a></h2>
ATTACHMENTS = [
{
url: 'demo.rst',
name: 'NtDocutils 0.2.1 - Demo.rst',
name: 'NtDocutils 0.2.2 - Demo.rst',
icon: 'code'
},
{
url: 'attachments/demo.pdf',
name: 'NtDocutils 0.2.1 - Demo.pdf'
name: 'NtDocutils 0.2.2 - Demo.pdf'
}
];
</script></div>
Expand All @@ -1055,7 +1055,7 @@ <h2><a class="toc-backref" href="#id46">Block syntax highlighting</a></h2>
</div>

<div>
Licensed under <a href="https://github.com/ntrrg/NtDocutils/blob/v0.2.1/LICENSE">The MIT License</a>
Licensed under <a href="https://github.com/ntrrg/NtDocutils/blob/v0.2.2/LICENSE">The MIT License</a>
</div>

<div>Powered by <a href="http://docutils.sourceforge.net/">Docutils</a> and <a href="https://getmdl.io/">MDL</a></div>
Expand All @@ -1081,13 +1081,19 @@ <h2><a class="toc-backref" href="#id46">Block syntax highlighting</a></h2>

<ul id="attachments-menu" data-mdl-for="attachments-button" class="mdl-menu mdl-menu--top-right mdl-js-menu mdl-js-ripple-effect"></ul>

<button id="lang-button" class="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--accent">
<i class="material-icons">language</i>
</button>

<ul id="lang-menu" data-mdl-for="lang-button" class="mdl-menu mdl-menu--top-right mdl-js-menu mdl-js-ripple-effect"></ul>

<button id="print-button" class="mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--accent">
<i class="material-icons">print</i>
</button>
</div>
</div>

<script type='text/javascript' src='https://code.getmdl.io/1.3.0/material.min.js'></script><script type='text/javascript' src='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.1/ntdocutils/themes/mdl/js/ntdocutils.min.js'></script>
<script type='text/javascript' src='https://code.getmdl.io/1.3.0/material.min.js'></script><script type='text/javascript' src='https://cdn.rawgit.com/ntrrg/NtDocutils/v0.2.2/ntdocutils/themes/mdl/js/ntdocutils.min.js'></script>

</div>
</body>
Expand Down
8 changes: 4 additions & 4 deletions docs/demo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Subtitle
Centro Empresarial Gran Mundo
Piso 7, oficina 7-3

:Version: 0.2.1
:Version: 0.2.2
:Date: 2018-03-17 21:20:00 -04:00
:License: `MIT <https://github.com/ntrrg/NtDocutils/blob/v0.2.1/LICENSE>`_
:License: `MIT <https://github.com/ntrrg/NtDocutils/blob/v0.2.2/LICENSE>`_

.. image:: images/ntdocutils.png
:class: article-image
Expand Down Expand Up @@ -556,12 +556,12 @@ Block syntax highlighting
ATTACHMENTS = [
{
url: 'demo.rst',
name: 'NtDocutils 0.2.1 - Demo.rst',
name: 'NtDocutils 0.2.2 - Demo.rst',
icon: 'code'
},
{
url: 'attachments/demo.pdf',
name: 'NtDocutils 0.2.1 - Demo.pdf'
name: 'NtDocutils 0.2.2 - Demo.pdf'
}
];
</script>
Expand Down
Loading

0 comments on commit 893301a

Please sign in to comment.