little overhaul
diff --git a/README.md b/README.md
index 5cea37b..2c471aa 100755
--- a/README.md
+++ b/README.md
@@ -5,16 +5,33 @@
It was originally created for the new Python documentation, and it has excellent facilities for the documentation of Python projects, but C/C++ is already supported as well, and it is planned to add special support for other languages as well.
-## Sample pillar
+## Sample pillars
+
+Simple documentation with local source
sphinx:
server:
enabled: true
- docs:
- - name: 'board'
- builder: 'html'
- source: '/path/to/sphinx/documentation'
+ doc:
+ board:
+ builder: 'html'
+ source:
+ engine: local
+ path: '/path/to/sphinx/documentation'
+
+Simple documentation with Git source
+
+ sphinx:
+ server:
+ enabled: true
+ doc:
+ board:
+ builder: 'html'
+ source:
+ engine: git
+ address: '/path/to/sphinx/documentation'
+ revision:
## Read more
-# http://sphinx-doc.org/tutorial.html
\ No newline at end of file
+* http://sphinx-doc.org/tutorial.html
\ No newline at end of file
diff --git a/server.sls b/server.sls
index 1323b57..f22683d 100755
--- a/server.sls
+++ b/server.sls
@@ -6,26 +6,54 @@
- python-sphinx
/srv/sphinx/sites:
- file:
- - directory
+ file.directory:
- mode: 755
- makedirs: true
-{%- for doc in pillar.sphinx.server.docs %}
+/srv/sphinx/extern:
+ file.directory:
+ - mode: 755
+ - makedirs: true
-/srv/sphinx/sites/{{ doc.name }}:
- file:
- - directory
+{%- for doc_name, doc in server.doc.iteritems() %}
+
+/srv/sphinx/sites/{{ doc_name }}:
+ file.directory:
- mode: 755
- makedirs: true
- require:
- file: /srv/sphinx/sites
-generate_sphinx_doc_{{ doc.name }}:
- cmd.run:
- - name: sphinx-build -b {{ doc.builder }} {{ doc.source }} /srv/sphinx/sites/{{ doc.name }}
+{%- if doc.source.engine == 'git' %}
+
+sphinx_source_{{ doc_name }}:
+ {{ doc.source.engine }}.latest:
+ - name: {{ doc.source.address }}
+ - target: /srv/sphinx/extern/{{ doc_name }}
+ - rev: {{ plugin.source.revision }}
- require:
- - file: /srv/sphinx/sites/{{ doc.name }}
+ - file: /srv/sphinx/extern
+ - require_in:
+ - cmd: generate_sphinx_doc_{{ doc_name }}
+
+generate_sphinx_doc_{{ doc_name }}:
+ cmd.run:
+ - name: sphinx-build -b {{ doc.builder }} /srv/sphinx/extern/{{ doc_name }} /srv/sphinx/sites/{{ doc_name }}
+ - require:
+ - git: sphinx_source_{{ doc_name }}
+ - file: /srv/sphinx/sites/{{ doc_name }}
+
+{%- endif -%}
+
+{%- if doc.source.engine == 'local' %}
+
+generate_sphinx_doc_{{ doc_name }}:
+ cmd.run:
+ - name: sphinx-build -b {{ doc.builder }} {{ doc.source.path }} /srv/sphinx/sites/{{ doc_name }}
+ - require:
+ - file: /srv/sphinx/sites/{{ doc_name }}
+
+{%- endif %}
{%- endfor %}