Skip to content

Commit

Permalink
Merge pull request #6970 from phadej/move-doc-to-top
Browse files Browse the repository at this point in the history
Move doc/ to the top-level of the repository
  • Loading branch information
phadej authored Jul 16, 2020
2 parents d8f890b + 2cb296d commit 7118ea0
Show file tree
Hide file tree
Showing 35 changed files with 29 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ dist-*
register.sh
./cabal.config
cabal-tests.log
.python-sphinx-virtualenv/

/Cabal/dist/
/Cabal/.python-sphinx-virtualenv/
/Cabal/tests/Setup
/Cabal/Setup
/Cabal/source-file-list
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2

sphinx:
configuration: Cabal/doc/conf.py
configuration: doc/conf.py

python:
version: 3.7
install:
- requirements: Cabal/doc/requirements.txt
- requirements: doc/requirements.txt
22 changes: 1 addition & 21 deletions Cabal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ SOURCES=Distribution/*.hs Distribution/Simple/*.hs \
CONFIG_STAMP=dist/setup-config
BUILD_STAMP=dist/build/libHSCabal-$(VERSION).a
HADDOCK_STAMP=dist/doc/html/Cabal/index.html
USERGUIDE_STAMP=dist/doc/users-guide/index.html
SDIST_STAMP=dist/Cabal-$(VERSION).tar.gz
DISTLOC=dist/release
DIST_STAMP=$(DISTLOC)/Cabal-$(VERSION).tar.gz

# TODO: when we have sphinx-build2 ?
SPHINXCMD:=sphinx-build

COMMA=,

setup: $(SOURCES) Setup.hs
Expand All @@ -51,20 +47,6 @@ haddock: $(HADDOCK_STAMP)
$(HADDOCK_STAMP) : $(CONFIG_STAMP) $(BUILD_STAMP)
./setup haddock

SPHINX_HTML_OUTDIR=dist/doc/users-guide

# do pip install everytime so we have up to date requirements when we build
users-guide: .python-sphinx-virtualenv $(USERGUIDE_STAMP)
$(USERGUIDE_STAMP) : doc/*.rst
mkdir -p $(SPHINX_HTML_OUTDIR)
(. ./.python-sphinx-virtualenv/bin/activate && pip install -r doc/requirements.txt && $(SPHINXCMD) doc $(SPHINX_HTML_OUTDIR))

docs: haddock users-guide

.python-sphinx-virtualenv:
python3 -m venv .python-sphinx-virtualenv
(. ./.python-sphinx-virtualenv/bin/activate)

clean:
rm -rf dist/
rm -f setup
Expand Down Expand Up @@ -93,17 +75,15 @@ $(SDIST_STAMP) : $(BUILD_STAMP)
./setup sdist

dist: $(DIST_STAMP)
$(DIST_STAMP) : $(HADDOCK_STAMP) $(USERGUIDE_STAMP) $(SDIST_STAMP)
$(DIST_STAMP) : $(HADDOCK_STAMP) $(SDIST_STAMP)
rm -rf $(DISTLOC)
mkdir $(DISTLOC)
tar -xzf $(SDIST_STAMP) -C $(DISTLOC)/
mkdir -p $(DISTLOC)/Cabal-$(VERSION)/doc
cp -r dist/doc/html $(DISTLOC)/Cabal-$(VERSION)/doc/API
cp -r dist/doc/users-guide $(DISTLOC)/Cabal-$(VERSION)/doc/
cp ChangeLog.md $(DISTLOC)/Cabal-$(VERSION)/
tar --format=ustar -C $(DISTLOC) -czf $(DISTLOC)/Cabal-$(VERSION).tar.gz Cabal-$(VERSION)
mkdir $(DISTLOC)/doc
mv $(DISTLOC)/Cabal-$(VERSION)/doc/users-guide $(DISTLOC)/doc
mv $(DISTLOC)/Cabal-$(VERSION)/doc/API $(DISTLOC)/doc
mv $(DISTLOC)/Cabal-$(VERSION)/ChangeLog.md $(DISTLOC)/
rm -r $(DISTLOC)/Cabal-$(VERSION)/
Expand Down
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ $(TEMPLATE_MACROS) : boot/cabal_macros.template.h cabal-dev-scripts/src/GenCabal

# generated docs

Cabal/doc/buildinfo-fields-reference.rst : phony
doc/buildinfo-fields-reference.rst : phony
cabal build --builddir=dist-newstyle-bi --project-file=cabal.project.buildinfo buildinfo-reference-generator
$$(cabal-plan list-bin --builddir=dist-newstyle-bi buildinfo-reference-generator) buildinfo-reference-generator/template.zinza | tee $@

Expand Down Expand Up @@ -226,3 +226,25 @@ weeder :
.PHONY : tags
tags :
hasktags -b Cabal/Distribution Cabal/Cabal-described/src Cabal/Language cabal-install/Distribution cabal-testsuite/src

# documentation
##############################################################################

# TODO: when we have sphinx-build2 ?
SPHINXCMD:=sphinx-build
SPHINX_HTML_OUTDIR:=dist-newstyle/doc/users-guide
USERGUIDE_STAMP:=$(SPHINX_HTML_OUTDIR)/index.html

# do pip install everytime so we have up to date requirements when we build
users-guide: .python-sphinx-virtualenv $(USERGUIDE_STAMP)
$(USERGUIDE_STAMP) : doc/*.rst
mkdir -p $(SPHINX_HTML_OUTDIR)
(. ./.python-sphinx-virtualenv/bin/activate && pip install -r doc/requirements.txt && $(SPHINXCMD) doc $(SPHINX_HTML_OUTDIR))

docs: haddock users-guide

.python-sphinx-virtualenv:
python3 -m venv .python-sphinx-virtualenv
(. ./.python-sphinx-virtualenv/bin/activate)


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.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Cabal/doc/conf.py → doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
html_use_smartypants = True
html_show_copyright = True
html_context = {
'source_url_prefix': "https://github.com/haskell/cabal/tree/master/Cabal/doc/",
'source_url_prefix': "https://github.com/haskell/cabal/tree/master/doc/",
"display_github": True,
"github_host": "github.com",
"github_user": "haskell",
"github_repo": 'cabal',
"github_version": "master/",
"conf_py_path": "Cabal/doc/",
"conf_py_path": "doc/",
"source_suffix": '.rst',
}

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.
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.
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.

0 comments on commit 7118ea0

Please sign in to comment.