From 28c6f4ac56fe4256f341aeea9f77cd8883770d7b Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Fri, 8 Jul 2016 20:19:54 +0200 Subject: [PATCH 1/2] POC: Make unified sections and Vim folds work. Related to: https://github.com/debops/docs/issues/156 Is currently based on development version of yaml2rst. --- .gitmodules | 5 +++++ docs/conf.py | 13 +++++++------ docs/requirements.txt | 4 +++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.gitmodules b/.gitmodules index 516658d..54020ea 100644 --- a/.gitmodules +++ b/.gitmodules @@ -271,15 +271,20 @@ [submodule "docs/ansible/roles/ansible-resources"] path = docs/ansible/roles/ansible-resources url = https://github.com/debops/ansible-resources + ignore = untracked [submodule "docs/ansible/roles/ansible-slapd"] path = docs/ansible/roles/ansible-slapd url = https://github.com/debops/ansible-slapd + ignore = untracked [submodule "docs/ansible/roles/ansible-ruby"] path = docs/ansible/roles/ansible-ruby url = https://github.com/debops/ansible-ruby + ignore = untracked [submodule "docs/ansible/roles/ansible-golang"] path = docs/ansible/roles/ansible-golang url = https://github.com/debops/ansible-golang + ignore = untracked [submodule "docs/ansible/roles/ansible-nodejs"] path = docs/ansible/roles/ansible-nodejs url = https://github.com/debops/ansible-nodejs + ignore = untracked diff --git a/docs/conf.py b/docs/conf.py index 9e92bd8..2728f16 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,12 +18,13 @@ # Generate documentation on the fly based on Ansible default variables import yaml2rst -try: - for element in os.listdir('ansible/roles'): - if os.path.isdir('ansible/roles/' + element): - yaml2rst.convert_file('ansible/roles/' + element + '/defaults/main.yml', 'ansible/roles/' + element + '/docs/defaults.rst') -except: - pass +for element in os.listdir('ansible/roles'): + if os.path.isdir('ansible/roles/' + element): + yaml2rst.convert_file( + 'ansible/roles/' + element + '/defaults/main.yml', + 'ansible/roles/' + element + '/docs/defaults.rst', + strip_regex=r'\s*(:?\[{3}|\]{3})\d?$', + ) # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/docs/requirements.txt b/docs/requirements.txt index 1a9433c..298d806 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,3 @@ -yaml2rst +## Install unreleased develop version until htgoebel makes a release. +# yaml2rst +https://github.com/ypid/yaml2rst/archive/feature/expose-strip_regex.zip From cd7bf4ae5fbb9ff52e76cb248ac926409f18caee Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Fri, 8 Jul 2016 20:32:14 +0200 Subject: [PATCH 2/2] Let Travis install requirements from requirements file. Why have a requirements file and not use it?? --- .travis.yml | 2 +- docs/requirements.txt | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index b5015c7..9b0b09e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - "2.7" # command to install dependencies -install: "pip install -q yaml2rst sphinx==1.3.4" +install: "pip install -r docs/requirements.txt" # command to run tests script: ./test.sh -W diff --git a/docs/requirements.txt b/docs/requirements.txt index 298d806..e6e7c52 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,3 +1,5 @@ -## Install unreleased develop version until htgoebel makes a release. +sphinx==1.3.4 + +## TODO: Install unreleased develop version until htgoebel makes a release. # yaml2rst https://github.com/ypid/yaml2rst/archive/feature/expose-strip_regex.zip