Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makes the transifex build automatic. #1824

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -3,6 +3,9 @@

# Generated Files
*/_build/*
locale
_build
.tx
build/vendor/
build/server/
build/composer.lock
Expand Down
19 changes: 7 additions & 12 deletions Makefile
@@ -1,6 +1,6 @@
all: html pdf
all: html pdf upload-user-manual-strings-transifex

html: admin-manual-html user-manual-html user-manual-de-html developer-manual-html
html: admin-manual-html user-manual-html developer-manual-html
pdf: admin-manual-pdf user-manual-pdf user-manual-de-pdf

admin-manual-html:
Expand All @@ -9,16 +9,11 @@ admin-manual-html:
@echo "Admin manual build finished; HTML is updated"

user-manual-html:
rm -rf user_manual/_build/html/com
rm -rf user_manual/_build/html
cd user_manual && make html
@echo "User manual build finished; HTML is updated"

user-manual-de-html:
rm -rf user_manual_de/_build/html/com
cd user_manual_de && make html
@echo "User manual de build finished; HTML is updated"

developer-manual-html: icons-docs
developer-manual-html: api-docs icons-docs
rm -rf developer_manual/_build/html/com
cd developer_manual && make html
@echo "Developer manual build finished; HTML is updated"
Expand All @@ -31,9 +26,9 @@ user-manual-pdf:
cd user_manual && make latexpdf
@echo "User manual build finished; PDF is updated"

user-manual-de-pdf:
cd user_manual_de && make latexpdf
@echo "User manual de build finished; PDF is updated"
upload-user-manual-strings-transifex:
cd user_manual && make gettext && tx push --source
@echo "English Strings for user manual have been uploaded to transifex, ready to be translated!"

icons-docs: clean-icons-docs
cd build && sh get-server-sources.sh $(DRONE_BRANCH)
Expand Down
7 changes: 7 additions & 0 deletions README.rst
Expand Up @@ -71,6 +71,13 @@ your username). You will then be able to make changes easily. Once done,
you can create a pull request and get the changes reviewed and back into
the official repository.

Translations
------------

[Help translate the documentation](https://www.transifex.com/indiehosters/nextcloud-user-documentation/dashboard/).

For developers that want to ease the translation process, please read [this documentation](https://docs.transifex.com/integrations/sphinx-doc).

Building
--------

Expand Down
37 changes: 24 additions & 13 deletions user_manual/Makefile
Expand Up @@ -13,6 +13,7 @@ PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
LANGS = en fr cs

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

Expand Down Expand Up @@ -42,19 +43,29 @@ help:
clean:
-rm -rf $(BUILDDIR)/*

html: html-com

html-all: html-release html-com

html-release:
$(SPHINXBUILD) -b html -D html_theme='sphinx_rtd_theme' $(ALLSPHINXOPTS) $(BUILDDIR)/html/release
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/release."

html-com:
$(SPHINXBUILD) -b html -D html_theme='sphinx_rtd_theme' $(ALLSPHINXOPTS) $(BUILDDIR)/html/com
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/com."
html:
make html-all merge-folders

html-all: $(foreach lang, $(LANGS), html-lang-$(lang))

html-lang-%:
make get-translated-strings-$*
$(SPHINXBUILD) -b html -D html_theme='sphinx_rtd_theme' -D language=$* $(ALLSPHINXOPTS) $(BUILDDIR)/html/$*
@echo "Build finished for LANG=$*. The HTML pages are in $(BUILDDIR)/html/$*."

get-translated-strings-%:
@if [ "$*" != "en" ]; then tx pull -l $*; fi;
@echo "Got all latest translated strings from transifex for LANG $*."

merge-folders:
mv $(BUILDDIR)/html/en/_static .
mv $(BUILDDIR)/html/en/_images .
cd $(BUILDDIR)/html/ && rm -rf `find -type d -name _static`
cd $(BUILDDIR)/html/ && rm -rf `find -type d -name _images`
mv ./_images $(BUILDDIR)/html/
mv ./_static $(BUILDDIR)/html/
cd $(BUILDDIR)/html/ && find ./ -type f -exec sed -i -e 's/_images/..\/_images/g' {} \;
cd $(BUILDDIR)/html/ && find ./ -type f -exec sed -i -e 's/_static/..\/_static/g' {} \;

dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
Expand Down
9 changes: 8 additions & 1 deletion user_manual/conf.py
Expand Up @@ -58,7 +58,7 @@

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -158,6 +158,9 @@
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
html_show_sphinx = False

# If true, the reST sources are included in the HTML build as _sources/name. The default is True.
html_copy_source = False

# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True

Expand Down Expand Up @@ -309,3 +312,7 @@
# Generate the versions list
html_context['versions'] = generateVersionsDocs(current_docs)
html_context['theme_vcs_pageview_mode'] += current_docs

# translation
locale_dirs = ['locale/'] # path is example but recommended.
gettext_compact = False # optional.
Binary file removed user_manual_de/Create HTML.lnk
Binary file not shown.
Binary file removed user_manual_de/Create PDF.lnk
Binary file not shown.