From e9231bc47c5c9b765c9b10cbdf33643ea9001a6b Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 27 Aug 2019 19:30:27 -0400 Subject: [PATCH 1/6] Add book link to readme Signed-off-by: Roberto Rosario --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index cc0cb970fa..7a265298ae 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,16 @@ +

Book

+ +The pre-release version of the book "Exploring Mayan EDMS" available now at a discounted price! + + + +Limited quantities. Buyers of the pre-release will get the full version for free when it is ready. + +The link is https://sellfy.com/p/um2fkx/ +

Installation

The easiest way to use Mayan EDMS is by using the official From b5ac83767d9862f6a4cbb2f32580e46e5043e626 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 27 Aug 2019 22:35:58 -0400 Subject: [PATCH 2/6] Add center book image Signed-off-by: Roberto Rosario --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7a265298ae..2b4a435120 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Donation](https://img.shields.io/badge/Donation-PayPal-brightgreen)](https://paypal.me/MayanEDMS) [![pypi][pypi]][pypi-url] [![builds][builds]][builds-url] [![coverage][cover]][cover-url] @@ -5,7 +6,7 @@ ![license][license] [![Docker pulls](https://img.shields.io/docker/pulls/mayanedms/mayanedms.svg?maxAge=3600)](https://hub.docker.com/r/mayanedms/mayanedms/) [![Docker Stars](https://img.shields.io/docker/stars/mayanedms/mayanedms.svg?maxAge=3600)](https://hub.docker.com/r/mayanedms/mayanedms/) -[![Docker layers](https://images.microbadger.com/badges/image/mayanedms/mayanedms.svg)](https://microbadger.com/images/mayanedms/mayanedms) + [pypi]: http://img.shields.io/pypi/v/mayan-edms.svg [pypi-url]: http://badge.fury.io/py/mayan-edms @@ -47,7 +48,11 @@ The pre-release version of the book "Exploring Mayan EDMS" available now at a discounted price! - +

+ + + +

Limited quantities. Buyers of the pre-release will get the full version for free when it is ready. From 7dda3225b324a9599b906563261d1c923a169c72 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 27 Aug 2019 22:43:53 -0400 Subject: [PATCH 3/6] Update book links Signed-off-by: Roberto Rosario --- README.md | 3 +-- README.rst | 14 +++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2b4a435120..37026453b4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ -[![Donation](https://img.shields.io/badge/Donation-PayPal-brightgreen)](https://paypal.me/MayanEDMS) +[![Donation](https://img.shields.io/badge/donation-PayPal-brightgreen)](https://paypal.me/MayanEDMS) [![pypi][pypi]][pypi-url] [![builds][builds]][builds-url] -[![coverage][cover]][cover-url] ![python][python] ![license][license] [![Docker pulls](https://img.shields.io/docker/pulls/mayanedms/mayanedms.svg?maxAge=3600)](https://hub.docker.com/r/mayanedms/mayanedms/) diff --git a/README.rst b/README.rst index 2066833da6..25498d500c 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -|pypi| |builds| |coverage| |python| |license| |docker_pulls| |docker_stars| |docker_layers| +|donation| |pypi| |builds| |coverage| |python| |license| |docker_pulls| |docker_stars| |docker_layers| .. image:: https://gitlab.com/mayan-edms/mayan-edms/raw/master/docs/_static/mayan_logo.png @@ -25,6 +25,16 @@ at: https://docs.mayan-edms.com/topics/installation.html .. _Docker: https://www.docker.com/ +The pre-release version of the book "Exploring Mayan EDMS" available now at a discounted price! + +.. image:: https://camo.githubusercontent.com/89d2fe787507c9247aa7bb406e2682b53eb7a5f9/68747470733a2f2f64313273776274773731397934732e636c6f756466726f6e742e6e65742f696d616765732f76365270785734302f615030714b4c6a6b50694175585a6859754234352f774441554c417a4679782e6a7065673f773d353438 + :align: center + :width: 300 + :target: https://sellfy.com/p/um2fkx/ + +Limited quantities. Buyers of the pre-release will get the full version for free when it is ready. +Click the image or visit: https://sellfy.com/p/um2fkx/ + Hardware requirements - 2 Gigabytes of RAM (1 Gigabyte if OCR is turned off). @@ -44,6 +54,8 @@ Important links - `Videos `__ +.. |donation| image:: https://img.shields.io/badge/donation-PayPal-brightgreen + :target: https://paypal.me/MayanEDMS .. |pypi| image:: http://img.shields.io/pypi/v/mayan-edms.svg :target: http://badge.fury.io/py/mayan-edms .. |builds| image:: https://gitlab.com/mayan-edms/mayan-edms/badges/master/build.svg From 89bdfc5975f4eb163d4db64f61478f8d9bcd1e11 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 7 Nov 2019 01:39:04 -0400 Subject: [PATCH 4/6] Add debug when loading env config file Signed-off-by: Roberto Rosario --- docs/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 5605895f04..838f4e5131 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -258,10 +258,12 @@ extlinks = { def _load_env_file(filename='../config.env'): + print('Loading env file: {}'.format(filename)) result = [] with open(filename) as file_object: for line in file_object: if not line.startswith('#'): + print('Found entry: {}'.format(line)) key, value = line.strip().split('=') result.append(('|{}|'.format(key), value)) From ffb7be62678e2d286c5dcbb39dd9c1ab1569fc4e Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 7 Nov 2019 02:47:28 -0400 Subject: [PATCH 5/6] Remove explict Docker image version from docs Signed-off-by: Roberto Rosario --- docs/chapters/docker.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/chapters/docker.rst b/docs/chapters/docker.rst index aca7fbd0f2..6683b0b4c1 100644 --- a/docs/chapters/docker.rst +++ b/docs/chapters/docker.rst @@ -10,8 +10,8 @@ How to use this image Start a Mayan EDMS Docker image ------------------------------- -With Docker properly installed, proceed to download the Mayan EDMS image using -the command:: +With Docker properly installed, proceed to download the Mayan EDMS Docker +image using the command:: docker pull mayanedms/mayanedms: @@ -21,7 +21,7 @@ tag here, remember to do so in the next steps also.:: docker pull mayanedms/mayanedms:latest -Then download version 9.6 of the Docker PostgreSQL image:: +Then download the PostgreSQL Docker image:: docker pull |DOCKER_POSTGRES_IMAGE_VERSION| From 894db8eb194620e31bc730cb1e3f6ebd4ed384d1 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Thu, 7 Nov 2019 04:37:52 -0400 Subject: [PATCH 6/6] Patch Sphinx Include to support substitutions Signed-off-by: Roberto Rosario --- docs/conf.py | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 838f4e5131..796d2e5e27 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -13,7 +13,13 @@ from __future__ import unicode_literals # All configuration values have a default; values that are commented out # serve to show the default. -import sys, os +import os +import inspect +import sys + +from docutils.parsers.rst import directives +import docutils.parsers.rst.directives.misc +from sphinx.directives.other import Include as SphinxInclude sys.path.insert(0, os.path.abspath('..')) @@ -258,26 +264,55 @@ extlinks = { def _load_env_file(filename='../config.env'): - print('Loading env file: {}'.format(filename)) result = [] with open(filename) as file_object: for line in file_object: if not line.startswith('#'): - print('Found entry: {}'.format(line)) key, value = line.strip().split('=') result.append(('|{}|'.format(key), value)) return result -def GlobalSubstitution(app, docname, source): - for old, new in global_subtitutions: +def global_substitution_function(app, docname, source): + for old, new in global_subtitutions_list: source[0] = source[0].replace(old, new) +def monkey_path_include(): + """ + Monkey path docutil's Include directive to support global substitutions. + The Include class doesn't have a hook to modify the content before + inserting it back, so we add a call to our own transformation + method. We patch the base Include class, recreate Sphinx's Include class, + and register it as the new main include directive. + All this avoids copy and paste of the original code here. + """ + source_code = ''.join(inspect.getsourcelines( + docutils.parsers.rst.directives.misc.Include)[0] + ) + source_code = source_code.replace( + 'self.state_machine.insert_input(include_lines, path)', + 'include_lines=self.global_substitution(lines=include_lines)\n self.state_machine.insert_input(include_lines, path)', + ) + exec(source_code, docutils.parsers.rst.directives.misc.__dict__) + + class Include(docutils.parsers.rst.directives.misc.Include, SphinxInclude): + def global_substitution(self, lines): + result = [] + for line in lines: + for old, new in global_subtitutions_list: + line = line.replace(old, new) + result.append(line) + return result + + return Include + + def setup(app): app.add_stylesheet('css/custom.css') - app.connect('source-read', GlobalSubstitution) + app.connect('source-read', global_substitution_function) + directives.register_directive('include', monkey_path_include()) -global_subtitutions = _load_env_file() +global_subtitutions_list = _load_env_file()