docs(appium): hide erroneous release tag and copy generic assets into each language dir
MODIFY
package.json
package.json
"npm-run-all": "4.1.5",
"pre-commit": "1.2.2",
"rewiremock": "3.14.3",
+ "rimraf": "3.0.2",
"serve-static": "1.15.0",
"sinon": "13.0.2",
"sinon-chai": "3.7.0",

ADD
packages/appium/docs/.gitignore
+en/assets
+ja/assets

RENAME
packages/appium/docs/en/assets/appium-logo-horiz-white.png
packages/appium/docs/assets/images/appium-logo-horiz-white.png
RENAME
packages/appium/docs/en/assets/appium-logo-horiz.png
packages/appium/docs/assets/images/appium-logo-horiz.png
RENAME
packages/appium/docs/en/assets/appium-logo-white.png
packages/appium/docs/assets/images/appium-logo-white.png
RENAME
packages/appium/docs/en/assets/appium-logo.png
packages/appium/docs/assets/images/appium-logo.png
ADD
packages/appium/docs/assets/stylesheets/extra.css
+.md-source__fact--version {
+ display: none;
+}
+.md-source__fact:nth-child(1n+2)::before {
+ margin-left: 0;
+}

MODIFY
packages/appium/docs/base-mkdocs.yml
packages/appium/docs/base-mkdocs.yml
@@ -4,6 +4,13 @@ repo_url: https://github.com/appium/appium
repo_name: appium/appium
copyright: Copyright &copy; 2012 - 2022 OpenJS Foundation
+theme:
+ logo: assets/images/appium-logo-white.png
+ favicon: assets/images/appium-logo.png
+
+extra_css:
+ - assets/stylesheets/extra.css
+
extra:
homepage: /
social:

ADD
packages/appium/docs/copy-assets.js
+const path = require('path');
+const { fs, logger } = require('@appium/support');
+
+const log = logger.getLogger('Docs');
+
+const DOCS_DIR = path.resolve(__dirname);
+const ASSETS_DIR = path.join(DOCS_DIR, 'assets');
+const LANGS = ['en', 'ja'];
+
+async function main () {
+ log.info('Copying generic assets to docs language dirs');
+
+ for (const lang of LANGS) {
+ const langPath = path.join(DOCS_DIR, lang);
+ const langAssetPath = path.join(langPath, 'assets');
+ log.info(`Deleting ${langAssetPath}`);
+ await fs.rimraf(langAssetPath);
+ log.info(`Copying assets into ${langAssetPath}`);
+ await fs.copyFile(ASSETS_DIR, langAssetPath);
+ }
+}
+
+main().catch((err) => {
+ throw err;
+});

MODIFY
packages/appium/docs/mkdocs-en.yml
packages/appium/docs/mkdocs-en.yml
@@ -7,8 +7,6 @@ docs_dir: en
theme:
language: en
- logo: assets/appium-logo-white.png
- favicon: assets/appium-logo.png
nav:
- Home: index.md

MODIFY
packages/appium/package.json
packages/appium/package.json
"build": "babel lib --root-mode=upward --out-dir=build/lib",
"dev": "npm run build -- --watch",
"fix": "npm run lint -- --fix",
- "dev:docs": "npm run dev:docs:en",
+ "build:docs": "run-s build:docs:*",
+ "build:docs:assets": "node docs/copy-assets.js",
+ "build:docs:en": "mkdocs build -f ./docs/mkdocs-en.yml",
+ "dev:docs": "npm run build:docs:assets && npm run dev:docs:en",
"dev:docs:en": "mkdocs serve -f ./docs/mkdocs-en.yml",
"dev:docs:ja": "mkdocs serve -f ./docs/mkdocs-ja.yml",
"postinstall": "node ./scripts/postinstall.js",

docs(appium): hide erroneous release tag and copy generic assets into each language dir