Skip to content

Commit

Permalink
Update build tools, remove old references to odk, and remove the need…
Browse files Browse the repository at this point in the history
… for shared-src dir
  • Loading branch information
wbrunette committed Sep 27, 2020
1 parent c4e413b commit a9ddbf6
Show file tree
Hide file tree
Showing 27 changed files with 121 additions and 194 deletions.
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
#

# You can set these variables from the command line.
PYTHON = python3
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = ODKX
ODKX_SRCDIR = odkx-src
SHARED_SRCDIR = shared-src
COMPILE_X_SRCDIR = tmpx-src
ODKX_BUILDDIR = odkx-build

Expand All @@ -32,7 +32,6 @@ clean: odkx-clean
odkx-copy: odkx-clean-files
mkdir $(COMPILE_X_SRCDIR)
cp -rf $(ODKX_SRCDIR)/* $(COMPILE_X_SRCDIR)
cp -rf $(SHARED_SRCDIR)/* $(COMPILE_X_SRCDIR)

odkx: odkx-copy
@$(SPHINXBUILD) -b dirhtml "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)" $(SPHINXOPTS)
Expand All @@ -44,7 +43,7 @@ build-all: odkx

odkx-latex: odkx
@$(SPHINXBUILD) -b latex "$(COMPILE_X_SRCDIR)" "$(ODKX_BUILDDIR)"/latex $(SPHINXOPTS)
python util/resize.py "$(ODKX_BUILDDIR)"
$(PYTHON) util/resize.py "$(ODKX_BUILDDIR)"

odkx-pdf: odkx-latex
cd "$(ODKX_BUILDDIR)"/latex && \
Expand All @@ -54,11 +53,11 @@ odkx-pdf: odkx-latex
mv ODK-X.pdf ../_downloads/ODK-X-Documentation.pdf

odkx-style-check: odkx
python style-test.py -r $(COMPILE_X_SRCDIR)
$(PYTHON) style-test.py -r $(COMPILE_X_SRCDIR)

odkx-spell-check: odkx
sphinx-build -b spelling $(COMPILE_X_SRCDIR) $(ODKX_BUILDDIR)/spelling
python util/check-spelling-output.py $(ODKX_BUILDDIR)
$(PYTHON) util/check-spelling-output.py $(ODKX_BUILDDIR)

odkx-check: odkx-style-check odkx-spell-check

Expand Down
82 changes: 40 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ It can take a long time (>10 minutes) to clone the repo due to the large number

### Building the Docker image

Next, you need to build the Docker image with all the tools you will be using to work with ODK's docs.
Next, you need to build the Docker image with all the tools you will be using to work with ODK-X's docs.

```
docker build -t odk-docs .
docker build -t odkx-docs .
```

It can take a long time to build the Docker image, but you only need to do this once.
Expand All @@ -63,10 +63,10 @@ Changes you make in the source files will automatically be built and shown in yo

Press `Ctrl-C` on your keyboard to stop the build server. It could take a while to effectively stop, and you can always close the terminal window.

If you get a `The name "odk-docs" is already in use by container` error message, run the following command:
If you get a `The name "odkx-docs" is already in use by container` error message, run the following command:

```
docker kill odk-docs
docker kill odkx-docs
```

### Other build tasks
Expand All @@ -91,62 +91,61 @@ We highly recommend you use a virtual environment like [virtualenv](https://virt

.. _virtual environment: https://docs.python.org/3/tutorial/venv.html

#. Create the virtual environment.

.. tabs::

.. group-tab:: Bash
#. Create a directory called 'odkx'
Create a directory for the documents. For the purposes of these directions we will use the folder 'odkx' as the directory that will contain the ODK-X Docs environment.

.. code:: console
mkdir odkx
Next, navigate the command line interface to inside the directory.
cd odkx

/odk/ $ python3 -m venv odkenv

.. group-tab:: PowerShell
#. Create the virtual environment.

.. code:: powershell

/odk/ > python -m venv odkenv
Next create the virtual environment inside the 'odkx' directory.
Bash

#. Activate the virtual environment.
/odkx/ $ python3 -m venv odkxenv

.. tabs::
PowerShell

.. group-tab:: Bash
.. code:: console
/odkx/ > python -m venv odkxenv

/odk/ $ source odkenv/bin/activate
(odkenv) /odk/ $

.. group-tab:: PowerShell
#. Activate the virtual environment.

.. code:: console
Bash
/odkx/ $ source odkxenv/bin/activate
(odkxenv) /odkx/ $

/odk/ > source odkenv/bin/activate
(odkenv) /odk/ >
PowerShell
/odkx/ > source odkxenv/bin/activate
(odkxenv) /odkx/ >

The ``(odkenv)`` before the prompt shows that the virtual environment is active.
The ``(odkxenv)`` before the prompt shows that the virtual environment is active.
You will need to have this active any time you are working on the docs.
If the file cannot be found, your activate file may be located under odkenv/scripts/activate.
If the file cannot be found, your activate file may be located under odkxenv/scripts/activate.

Later, to deactivate the virtual environment:

.. tabs::

.. group-tab:: Bash
.. code:: console

(odkenv) /odk/ $ deactivate
/odk/ $
Bash

.. group-tab:: PowerShell
(odkxenv) /odkx/ $ deactivate
/odkx/ $

.. code:: console
PowerShell

(odkenv) /odk/ > deactivate
/odk/ >
(odkxenv) /odkx/ > deactivate
/odkx/ >

### Cloning the repo
Expand Down Expand Up @@ -188,8 +187,7 @@ We are open for new issues and pull requests.

- Please read the [Contributors Guide](https://docs.odk-x.org/contributing) before working on the documentation.
- Find issues to work on.
- First time contributors are encouraged to complete a [line edit](https://github.com/getodk/docs/issues/96) as a way to get familiar with our contribution process.
- Issues labelled [easy](https://github.com/odk-x/docs/labels/easy) do not require much specific technical knowledge.
- Issues labelled [easy](https://github.com/odk-x/docs/labels/easy) do not require much specific technical knowledge.
- Issues labelled [contributor friendly](https://github.com/odk-x/docs/labels/contributor%20friendly) are usually self-contained and don't require extensive knowledge of the ODK-X ecosystem as a whole.

You can also...
Expand Down
File renamed without changes.
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// This JS file is in shared-src.
// Implement Details-like hide/show on class "details"

$(function(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@
{% endif %}

<hr/>
<p class="footerText"> <a href="{{ pathto(odk_pdf, 1) }}" download> {{ download_pdf }} </a></p>
<p class="footerText"> <a href="{{ pathto(odkx_pdf, 1) }}" download> {{ download_pdf }} </a></p>
<p class="footerText"> {{ faq_help }} <a href="{{ forum_here }}"> {{ forum }} </a> </p>
<p class="footerText"> {{ prob_in_doc }} <a href="{{ file_issue_here }}"> {{ file_issue }} </a> </p>
<p class="footerText"> {{ contri_start }} <a href="{{ repo_here }}"> {{ fork_repo }} </a> {{ join }} <a href="{{ pathto('contributing') }}"> {{ contri }} </a></p>

<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>

<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>

<div role="contentinfo">
<p>
{%- if show_copyright %}
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions odkx-src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,14 +249,14 @@
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {
# 'py': ('https://docs.python.org/', None),
'odk1': ('https://docs.odk-x.org/', None)
'odkx': ('https://docs.odk-x.org/', None)
}

# Add custom CSS

def setup(app):
app.add_stylesheet('css/custom.css')
app.add_javascript('js/custom.js')
app.add_css_file('css/custom.css')
app.add_js_file('js/custom.js')

# At top of every document

Expand All @@ -280,7 +280,7 @@ def setup(app):
Download this documentation as a PDF.
"""
odk_pdf = """
odkx_pdf = """
_downloads/ODK-X-Documentation.pdf
Expand Down Expand Up @@ -360,7 +360,7 @@ def setup(app):
"""

html_context = {'download_pdf' : download_pdf,
'odk_pdf' : odk_pdf,
'odkx_pdf' : odkx_pdf,
'prob_in_doc' : prob_in_doc ,
'contri_start' : contri_start ,
'join' : join ,
Expand All @@ -374,7 +374,7 @@ def setup(app):
'contri_guide' : contri_guide ,
'forum_here' : forum_here ,
'display_github' : True,
'github_user' : "opendatakit", # Username
'github_user' : "odk-x", # Username
'github_repo' : "docs", # Repo name
'github_version' : "master", # Version
'conf_py_path' : "/odkx-src/" # Path in the checkout to the docs root
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
82 changes: 5 additions & 77 deletions shared-src/docs-tech-guide.rst → odkx-src/docs-tech-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1053,15 +1053,10 @@ Working on the docs
Finally, you can open an :ref:`editor of your choice <choose-editor>`
and work on the documentation.

The source files for documentation text are in these directories:
The source files for documentation text are in these directory:

:file:`odk1-src`
Files for the pages at https://docs.odk-x.org
:file:`odkx-src`
Files for the pages at https://docs.odk-x.org/odk-x
:file:`shared-src`
Files for pages shared by both ODK1 and ODK-X docs.
(This page and the other contributor guide pages.)
Files for the pages at https://docs.odk-x.org/

If you're going to write or edit documentation text, please read:

Expand All @@ -1084,36 +1079,13 @@ Working on the docs
you should run the tests locally first
and correct any problems.

If you've been working on files in :file:`odk1-src` or :file:`shared-src`:

.. tabs::

.. group-tab:: Bash

.. code:: console
(odkenv) /odk/docs/ $ make odk1-check
.. group-tab:: PowerShell

.. code:: powershell
(odkenv) /odk/docs/ > rm -r -fo tmp1-src
(odkenv) /odk/docs/ > rm -r -fo odk1-build
(odkenv) /odk/docs/ > Copy-Item odk1-src -Destination tmp1-src -Recurse
(odkenv) /odk/docs/ > Copy-Item shared-src -Destination tmp1-src -Recurse
(odkenv) /odk/docs/ > sphinx-build -b spelling tmp1-src odk1-build/spelling
(odkenv) /odk/docs/ > python util/check-spelling-output.py odk1-build
If you've been working on files in :file:`odkx-src`:

.. tabs::

.. group-tab:: Bash

.. code:: console
(odkenv) /odk/docs/ $ make odkx-spell-check
(odkenv) /odk/docs/ $ make odkx-check
.. group-tab:: PowerShell

Expand All @@ -1122,8 +1094,7 @@ Working on the docs
(odkenv) /odk/docs/ > rm -r -fo tmpx-src
(odkenv) /odk/docs/ > rm -r -fo odkx-build
(odkenv) /odk/docs/ > Copy-Item odkx-src -Destination tmpx-src -Recurse
(odkenv) /odk/docs/ > Copy-Item shared-src -Destination tmpx-src -Recurse
(odkenv) /odk/docs/ > sphinx-build -b spelling tmp1-src odkx-build/spelling
(odkenv) /odk/docs/ > sphinx-build -b spelling tmpx-src odkx-build/spelling
(odkenv) /odk/docs/ > python util/check-spelling-output.py odkx-build
Expand Down Expand Up @@ -1164,28 +1135,6 @@ Working on the docs

.. _Sphinx: http://www.sphinx-doc.org

If you've been working on files in :file:`odk1-src` or :file:`shared-src`:

.. tabs::

.. group-tab:: Bash

.. code:: console
(odkenv) /odk/docs/ $ make odk1
.. group-tab:: PowerShell

.. code:: powershell
(odkenv) /odk/docs/ > rm -r -fo tmp1-src
(odkenv) /odk/docs/ > rm -r -fo odk1-build
(odkenv) /odk/docs/ > Copy-Item odk1-src -Destination tmp1-src -Recurse
(odkenv) /odk/docs/ > Copy-Item shared-src -Destination tmp1-src -Recurse
(odkenv) /odk/docs/ > sphinx-build -b dirhtml tmp1-src odk1-build
If you've been working on files in :file:`odkx-src`:

.. tabs::

.. group-tab:: Bash
Expand All @@ -1201,7 +1150,6 @@ Working on the docs
(odkenv) /odk/docs/ > rm -r -fo tmpx-src
(odkenv) /odk/docs/ > rm -r -fo odkx-build
(odkenv) /odk/docs/ > Copy-Item odkx-src -Destination tmpx-src -Recurse
(odkenv) /odk/docs/ > Copy-Item shared-src -Destination tmpx-src -Recurse
(odkenv) /odk/docs/ > sphinx-build -b dirhtml tmpx-src odkx-build
This generates a lot of output.
Expand Down Expand Up @@ -1248,7 +1196,7 @@ Working on the docs
The warning messages will refer to the file name
using the temporary directory path :file:`tmp1-src` or :file:`tmpx-src`.
You need to correct the problems in the real source directory
(:file:`odk1-src`, :file:`odkx-src`, or :file:`shared-src`).
(:file:`odkx-src`).

.. admonition:: When you just can't fix the error...

Expand All @@ -1265,26 +1213,6 @@ Working on the docs

.. _serve-the-docs-locally:

If you've been working on files in :file:`odk1-src` or :file:`shared-src`:

.. tabs::

.. group-tab:: Bash

.. code:: console
(odkenv) /odk/docs/ $ python -m http.server -d odk-build 8000
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)
.. group-tab:: PowerShell

.. code:: powershell
(odkenv) /odk/docs/ > python -m http.server -d odk1-build 8000
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)
If you've been working on files in :file:`odkx-src`:

.. tabs::

.. group-tab:: Bash
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes.
Loading

0 comments on commit a9ddbf6

Please sign in to comment.