Browse Source

Merge pull request #9944 from afshin/toplevel-changelog

Move Changelog to Standard Location
Steven Silvester 4 years ago
parent
commit
8a6727a6e8
4 changed files with 23 additions and 18 deletions
  1. 3 0
      .gitignore
  2. 0 0
      CHANGELOG.md
  3. 19 17
      docs/source/conf.py
  4. 1 1
      scripts/ci_script.sh

+ 3 - 0
.gitignore

@@ -96,6 +96,9 @@ iframe_figures/
 lerna-debug.log
 yarn-error.log
 
+# copied changelog file
+docs/source/getting_started/changelog.md
+
 junit.xml
 
 *.tsbuildinfo

+ 0 - 0
docs/source/getting_started/changelog.md → CHANGELOG.md


+ 19 - 17
docs/source/conf.py

@@ -21,6 +21,13 @@
 # import sys
 # sys.path.insert(0, os.path.abspath('.'))
 
+import os
+import os.path as osp
+import shutil
+from subprocess import check_call
+
+
+HERE = osp.abspath(osp.dirname(__file__))
 
 # -- General configuration ------------------------------------------------
 
@@ -64,8 +71,7 @@ author = 'Project Jupyter'
 # |version| and |release|, also used in various other places throughout the
 # built documents.
 
-import os
-_version_py = os.path.join('..', '..', 'jupyterlab', '_version.py')
+_version_py = osp.join(HERE, '..', '..', 'jupyterlab', '_version.py')
 version_ns = {}
 
 with open(_version_py, mode='r') as version_file:
@@ -97,23 +103,17 @@ todo_include_todos = False
 
 
 # build js docs and stage them to the build directory
-import os
-import shutil
-from subprocess import check_call
-
-
 def build_api_docs(out_dir):
     """build js api docs"""
-    here = os.path.dirname(os.path.abspath(__file__))
-    docs = os.path.join(here, os.pardir)
-    root = os.path.join(docs, os.pardir)
-    docs_api = os.path.join(docs, "api")
-    api_index = os.path.join(docs_api, "index.html")
+    docs = osp.join(HERE, os.pardir)
+    root = osp.join(docs, os.pardir)
+    docs_api = osp.join(docs, "api")
+    api_index = osp.join(docs_api, "index.html")
     # is this an okay way to specify jlpm
     # without installing jupyterlab first?
-    jlpm = ["node", os.path.join(root, "jupyterlab", "staging", "yarn.js")]
+    jlpm = ["node", osp.join(root, "jupyterlab", "staging", "yarn.js")]
 
-    if os.path.exists(api_index):
+    if osp.exists(api_index):
         # avoid rebuilding docs because it takes forever
         # `make clean` to force a rebuild
         print(f"already have {api_index}")
@@ -123,9 +123,9 @@ def build_api_docs(out_dir):
         check_call(jlpm + ["build:packages"], cwd=root)
         check_call(jlpm + ["docs"], cwd=root)
 
-    dest_dir = os.path.join(out_dir, "api")
+    dest_dir = osp.join(out_dir, "api")
     print(f"Copying {docs_api} -> {dest_dir}")
-    if os.path.exists(dest_dir):
+    if osp.exists(dest_dir):
         shutil.rmtree(dest_dir)
     shutil.copytree(docs_api, dest_dir)
 
@@ -259,5 +259,7 @@ intersphinx_mapping = {'https://docs.python.org/': None}
 
 
 def setup(app):
+    dest = osp.join(HERE, 'getting_started/changelog.md')
+    shutil.copy(osp.join(HERE, '..', '..', 'CHANGELOG.md'), dest)
     app.add_css_file('css/custom.css')  # may also be an URL
-    build_api_docs(app.outdir)
+    build_api_docs(app.outdir)

+ 1 - 1
scripts/ci_script.sh

@@ -72,7 +72,7 @@ if [[ $GROUP == linkcheck ]]; then
 
     # Run the link check on md files - allow for a link to fail once (--lf means only run last failed)
     args="--check-links --check-links-cache --check-links-cache-expire-after ${LINKS_EXPIRE} --check-links-cache-name ${CACHE_DIR}/cache"
-    args="--ignore docs/source/getting_started/changelog.md ${args}"
+    args="--ignore docs/source/getting_started/changelog.md --ignore CHANGELOG.md ${args}"
     py.test $args --links-ext .md -k .md . || py.test $args --links-ext .md -k .md --lf .
 
     conda deactivate