Skip to content

Commit

Permalink
Release 0.3.
Browse files Browse the repository at this point in the history
  • Loading branch information
htgoebel committed Apr 3, 2019
2 parents b753518 + 07a0053 commit cc4d831
Show file tree
Hide file tree
Showing 19 changed files with 727 additions and 122 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
*.egg-link

/nosetests.xml
/.cache
/.pytest_cache
/.coverage
/.tox
/.achievements
Expand Down
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: python
dist: xenial
python:
- "2.7"
- "3.4"
- "3.5"
- "3.6"
- "3.7"
before_install:
- python -m pip install -U pip setuptools | cat
install:
- python -m pip install -U -r requirements.txt | cat
- pip install .
script:
- pytest
- flake8
23 changes: 23 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Changelog for yaml2rst
=========================

0.3 (2019-04-03)
----------------

* Add options ``--strip-regex`` and ``--yaml-strip-regex`` for
filtering out Fold markers. See docs/fold-markers.rst for details.
* Add an example for formatting as definition lists.
* Make examples' HTML-build deterministic by removing the version
number.
* Add support for Python 3.
* Convert the module into a package.
* Enhance the test-suite.
* Move the project to the `debops` group for shared development.
* Enable CI-tests (at Travis-CI).


..
Local Variables:
mode: rst
ispell-local-dictionary: "american"
End:
6 changes: 6 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# dummy MANIFEST.in to keep zest.releaser calm
# unused since the source is in a git repository
#
#recursive-include docs *
#include *
global-exclude *.pyc
35 changes: 22 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is part of `yaml2rst`.
# Based on prior work from `gitflow`
# Copyright (c) 2010-2011 Vincent Driessen
# Copyright (c) 2012-2015 Hartmut Goebel
# Copyright (c) 2012-2019 Hartmut Goebel
# Distributed under a BSD-like license.
#

Expand Down Expand Up @@ -40,29 +40,38 @@ cover:
nosetests --with-coverage3 --cover-package=gitflow --with-spec --spec-color

dump-requirements:
pip freeze -l > .requirements
pip freeze -l > requirements.txt

install-requirements:
pip install -r .requirements
pip install -r requirements.txt

dist:
# ensure a clean build
@# ensure a clean build
rm -rf build
python setup.py sdist bdist
python setup.py sdist bdist_wheel

examples: PYTHONPATH = .
examples:
examples: examples/main.rst examples/main.html tests/patternsTest.html

examples/main.rst: examples/fold-markers-debops.yml examples/main.yml
PYTHONPATH=.
bin/yaml2rst examples/main.yml examples/main.rst
rst2html --stylesheet=examples/demo.css examples/main.rst > examples/main.html
rst2html --stylesheet=examples/demo.css tests/patternsTest.rst > tests/patternsTest.html
sed --regexp-extended 's/(\.\. )envvar(::)/\1note\2/;' $? \
| bin/yaml2rst - "$@" --strip-regex '\s*(:?\[{3}|\]{3})\d?$$' --yaml-strip-regex '^\s{66,67}#\s\]{3}\d?$$'
## --no-generator does not do the trick on Debian Jessie.

examples/main.html: examples/main.rst examples/demo.css
rst2html --stylesheet=examples/demo.css "$<" | grep --invert-match --fixed-strings '<meta name="generator"' > "$@"

tests/patternsTest.html: tests/patternsTest.rst examples/demo.css
rst2html --stylesheet=examples/demo.css "$<" > "$@"

#-- interaction with PyPI

test-upload:
python ./setup.py register -r https://testpypi.python.org/pypi
python ./setup.py sdist upload -r https://testpypi.python.org/pypi
test-upload: dist
twine upload --sign -r https://testpypi.python.org/pypi

test-install:
virtualenv /tmp/test-yaml2rst
/tmp/test-yaml2rst/bin/pip install -i https://testpypi.python.org/pypi yaml2rst

upload: dist
twine upload --sign
38 changes: 32 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A Simple Tool and Python-Module for Documenting YAML Files
--------------------------------------------------------------------------

:Author: Hartmut Goebel <h.goebel@crazy-compilers.com>
:Copyright: 2015 by Hartmut Goebel
:Copyright: 2015-2019 by Hartmut Goebel
:Licence: GNU General Public Licence v3 or later (GPLv3+)


Expand All @@ -21,14 +21,19 @@ allows to process the YAML file directly without any pre-processing.

Usage::

yaml2rst [-h] infile outfile
yaml2rst [-h] [--strip-regex regex] infile outfile

positional arguments:
infile YAML-file to read (`-` for stdin)
outfile rst-file to write (`-` for stdout)
infile YAML-file to read (`-` for stdin)
outfile rst-file to write (`-` for stdout)

optional arguments:
-h, --help show this help message and exit
-h, --help show this help message and exit
--strip-regex regex Regex which will remove everything it matches. Can be
used to remove fold markers from headings for example.
Example to strip out [[[,]]] fold markers:
'\s*(:?\[{3}|\]{3})\d?$'. Check the README for more
details.


How it works
Expand All @@ -43,13 +48,34 @@ Additionally at the start and at the end of a "code"-block, lines are
added as required by reStructuredText. Also at the begin of a
"code"-block, a ``::`` is added if required.

``--strip-regex`` can be used to remove matching characters from text-lines
when needed. Refer to documentation about
`Folding marks support <docs/fold-markers.rst>`_ for details.


Examples
-------------

You can find example yaml-input, rst-output and generated html in the
examples directory. You may also view the generated html online at
https://rawgit.com/htgoebel/yaml2rst/develop/examples/main.html.
https://rawgit.com/debops/yaml2rst/develop/examples/main.html.


Related Tools
---------------------

* `yaml4rst <https://pypi.org/project/yaml4rst/>`_ is a
linting/checking/reformatting tool for YAML files documented with
inline RST which goes hand in hand with yaml2rst.


Maintainers
---------------------

`yaml2rst` was originally developed 2015 and maintained by Hartmut
Goebel. In 2019 the project moved to the `debops` project for which
`yaml2rst` was developed.


..
Local Variables:
Expand Down
54 changes: 0 additions & 54 deletions bin/yaml2rst

This file was deleted.

Loading

0 comments on commit cc4d831

Please sign in to comment.