Skip to content

Commit

Permalink
restore makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelson-Gon committed Jul 19, 2022
1 parent 56a4d6b commit cca1b56
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,27 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
SOURCEDIR = docs/source
BUILDDIR = docs/build
PDFBUILDDIR = /tmp
PDF = ../docs_pdf.pdf

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

latexpdf:
@$(SPHINXBUILD) -b latex "$(SPHINXOPTS)" "$(PDFBUILDDIR)"/latex
@echo "Running LaTeX files through pdflatex..."
make -C "$(PDFBUILDDIR)"/latex all-pdf
cp "$(PDFBUILDDIR)"/latex/*.pdf $(PDF)
@echo "pdflatex finished; see $(PDF)"

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)


2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Otherwise:
# clone the repo
git clone [email protected]:Nelson-Gon/pyfdc.git
cd pyfdc
python3 setup.py install
python3 -m pip install .

```

Expand Down
2 changes: 1 addition & 1 deletion docs/source/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Otherwise:
# clone the repo
git clone [email protected]:Nelson-Gon/pyfdc.git
cd pyfdc
python3 setup.py install
python3 -m pip install .
**Sample usage**

Expand Down
5 changes: 3 additions & 2 deletions scripts/mkdocs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
base_dir="$(realpath "$0")"
file_location="$(dirname "$base_dir")"
modules_location="$(dirname "$file_location")"
use_python="$(which python || which python3)"
echo "Doc generator is located in" "$file_location" "while modules are in" "$modules_location"
echo -e "\e[0;36m Writing and moving README, contributing, and changelog to docs folder";

Expand All @@ -16,11 +17,11 @@ if [ ! -f docs/source/modules.rst ]

fi;

python -m m2r README.md changelog.md .github/CONTRIBUTING.md --overwrite
$use_python -m m2r README.md changelog.md .github/CONTRIBUTING.md --overwrite
mv .github/CONTRIBUTING.rst README.rst changelog.rst docs/source

echo "Building docs for" "$(dirname "$file_location")"
./make.bat html
make html
echo -e "\e[0;36m All done, commit latest changes if you wish."
echo -e "\e[0;36m If there were errors or warnings, delete modules.rst and ensure index.rst exists before trying again."

Expand Down

0 comments on commit cca1b56

Please sign in to comment.