Refactoring CSS/JS

This commit is contained in:
Kujiu 2020-06-19 23:39:59 +02:00
parent b302b93289
commit 49effa1b06
Signed by: kujiu
GPG key ID: ABBB2CAC6855599F
77 changed files with 4786 additions and 21174 deletions

3
.gitignore vendored
View file

@ -2,8 +2,7 @@ build
__pycache__
*.pyc
.*.swp
ui/node_modules
ui/dist
node_modules
dist
demo/_build
sphinx_nervproject_theme.egg-info

View file

@ -2,6 +2,15 @@
Changes
=======
1.1.0 (*2020-06-20*)
====================
- Remove dependency of vue, rewrite all JS
- Refactor all CSS
- Add print theme (some bugs must be fixed)
- Add weasyprint theme (some bugs must be fixed)
- Add epub theme (some bugs must be fixed)
1.0.8 (*2020-06-10*)
====================

View file

@ -23,14 +23,12 @@ See details on `Sphinx theming docs <http://www.sphinx-doc.org/en/master/theming
Development
~~~~~~~~~~~
First build web assets:
To rebuild web assets:
.. code:: bash
cd ui
npm run build
Sphinx theme has a soft link to built assets...
Install theme locally with `pip install -e .`.
`docs` folder contains theme's own documentantion.
@ -40,17 +38,6 @@ Install theme locally with `pip install -e .`.
cd docs
make clean; make html
Website
~~~~~~~
To update website:
.. code:: bash
cd ../press_site
rsync -rvi ../sphinx_vuepress_theme/docs/build/html/ .
git add --all
Compatibility
~~~~~~~~~~~~~

View file

@ -23,6 +23,7 @@ author = 'Kujiu'
# The full version, including alpha/beta/rc tags
release = '0.1'
version = '0.1'
# -- General configuration ---------------------------------------------------
@ -52,6 +53,13 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# a list of builtin themes.
#
html_theme = 'nervproject'
epub_theme = 'nervproject'
epub_exclude_files = [
'_static/sphinx_nervproject_print.css',
'_static/sphinx_nervproject_theme.css',
'_static/sphinx_nervproject_theme.js',
'_static/basic.css',
]
html_theme_options = {
"logoalt": project,
"social": [
@ -68,3 +76,7 @@ html_theme_options = {
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
weasyprint_theme = 'nervproject'
weasyprint_footer_selector = 'footer.footer'
weasyprint_header_selector = 'header.navbar'
weasyprint_main_selector = 'main.content'

View file

@ -52,6 +52,9 @@ Adds custom CSS files to the theme
If provided, creates external links (e.g. Github) in the top right corner:
``html_theme_options``
^^^^^^^^^^^^^^^^^^^^^^
.. code-block:: python
html_theme_options = {
@ -186,7 +189,7 @@ Links for previous/next page.
Copyright information.
``ui/src/vuepress/styles/config.less``
``ui/vuepress/styles/config.less``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This file contains the four sub-themes color schemes.

534
package-lock.json generated Normal file
View file

@ -0,0 +1,534 @@
{
"name": "sphinx_nervproject_theme",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"ajv": {
"version": "6.12.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz",
"integrity": "sha512-k+V+hzjm5q/Mr8ef/1Y9goCmlsK4I6Sm74teeyGvFk1XrOsbsKLjEdrvny42CZ+a8sXbk8KWpY/bDwS+FLL2UQ==",
"optional": true,
"requires": {
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
}
},
"amdefine": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
"integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU="
},
"asap": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz",
"integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=",
"optional": true
},
"asn1": {
"version": "0.2.4",
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
"integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
"optional": true,
"requires": {
"safer-buffer": "~2.1.0"
}
},
"assert-plus": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
"integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=",
"optional": true
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
"optional": true
},
"aws-sign2": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
"integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=",
"optional": true
},
"aws4": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz",
"integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==",
"optional": true
},
"bcrypt-pbkdf": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
"integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
"optional": true,
"requires": {
"tweetnacl": "^0.14.3"
}
},
"caseless": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
"optional": true
},
"clean-css": {
"version": "3.4.28",
"resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.28.tgz",
"integrity": "sha1-vxlF6C/ICPVWlebd6uwBQA79A/8=",
"requires": {
"commander": "2.8.x",
"source-map": "0.4.x"
},
"dependencies": {
"source-map": {
"version": "0.4.4",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
"integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
"requires": {
"amdefine": ">=0.0.4"
}
}
}
},
"clone": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
"integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18="
},
"combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"optional": true,
"requires": {
"delayed-stream": "~1.0.0"
}
},
"commander": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
"integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=",
"requires": {
"graceful-readlink": ">= 1.0.0"
}
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"optional": true
},
"dashdash": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
"integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0"
}
},
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"optional": true
},
"ecc-jsbn": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
"integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
"optional": true,
"requires": {
"jsbn": "~0.1.0",
"safer-buffer": "^2.1.0"
}
},
"errno": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz",
"integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==",
"optional": true,
"requires": {
"prr": "~1.0.1"
}
},
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
"optional": true
},
"extsprintf": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
"integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=",
"optional": true
},
"fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
"integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
"optional": true
},
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
"optional": true
},
"forever-agent": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
"integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=",
"optional": true
},
"form-data": {
"version": "2.3.3",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
"integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
"optional": true,
"requires": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.6",
"mime-types": "^2.1.12"
}
},
"getpass": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
"integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0"
}
},
"graceful-fs": {
"version": "4.2.4",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz",
"integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==",
"optional": true
},
"graceful-readlink": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU="
},
"har-schema": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
"integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=",
"optional": true
},
"har-validator": {
"version": "5.1.3",
"resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz",
"integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==",
"optional": true,
"requires": {
"ajv": "^6.5.5",
"har-schema": "^2.0.0"
}
},
"http-signature": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
"integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0",
"jsprim": "^1.2.2",
"sshpk": "^1.7.0"
}
},
"image-size": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.5.5.tgz",
"integrity": "sha1-Cd/Uq50g4p6xw+gLiZA3jfnjy5w=",
"optional": true
},
"is-typedarray": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=",
"optional": true
},
"isstream": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=",
"optional": true
},
"jsbn": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
"integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
"optional": true
},
"json-schema": {
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
"integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
"optional": true
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"optional": true
},
"json-stringify-safe": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
"integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=",
"optional": true
},
"jsprim": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
"integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
"optional": true,
"requires": {
"assert-plus": "1.0.0",
"extsprintf": "1.3.0",
"json-schema": "0.2.3",
"verror": "1.10.0"
}
},
"less": {
"version": "3.11.3",
"resolved": "https://registry.npmjs.org/less/-/less-3.11.3.tgz",
"integrity": "sha512-VkZiTDdtNEzXA3LgjQiC3D7/ejleBPFVvq+aRI9mIj+Zhmif5TvFPM244bT4rzkvOCvJ9q4zAztok1M7Nygagw==",
"requires": {
"clone": "^2.1.2",
"errno": "^0.1.1",
"graceful-fs": "^4.1.2",
"image-size": "~0.5.0",
"make-dir": "^2.1.0",
"mime": "^1.4.1",
"promise": "^7.1.1",
"request": "^2.83.0",
"source-map": "~0.6.0",
"tslib": "^1.10.0"
}
},
"less-plugin-clean-css": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/less-plugin-clean-css/-/less-plugin-clean-css-1.5.1.tgz",
"integrity": "sha1-zFeveqM5iVflbezr5jy2DCNClwM=",
"requires": {
"clean-css": "^3.0.1"
}
},
"make-dir": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
"optional": true,
"requires": {
"pify": "^4.0.1",
"semver": "^5.6.0"
}
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"optional": true
},
"mime-db": {
"version": "1.44.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
"integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
"optional": true
},
"mime-types": {
"version": "2.1.27",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
"integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
"optional": true,
"requires": {
"mime-db": "1.44.0"
}
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
"integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
"optional": true
},
"performance-now": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"optional": true
},
"pify": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
"optional": true
},
"promise": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
"integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==",
"optional": true,
"requires": {
"asap": "~2.0.3"
}
},
"prr": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
"integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=",
"optional": true
},
"psl": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
"integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==",
"optional": true
},
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
"optional": true
},
"qs": {
"version": "6.5.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==",
"optional": true
},
"request": {
"version": "2.88.2",
"resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
"integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
"optional": true,
"requires": {
"aws-sign2": "~0.7.0",
"aws4": "^1.8.0",
"caseless": "~0.12.0",
"combined-stream": "~1.0.6",
"extend": "~3.0.2",
"forever-agent": "~0.6.1",
"form-data": "~2.3.2",
"har-validator": "~5.1.3",
"http-signature": "~1.2.0",
"is-typedarray": "~1.0.0",
"isstream": "~0.1.2",
"json-stringify-safe": "~5.0.1",
"mime-types": "~2.1.19",
"oauth-sign": "~0.9.0",
"performance-now": "^2.1.0",
"qs": "~6.5.2",
"safe-buffer": "^5.1.2",
"tough-cookie": "~2.5.0",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"optional": true
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"optional": true
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
"optional": true
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
"integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==",
"optional": true,
"requires": {
"asn1": "~0.2.3",
"assert-plus": "^1.0.0",
"bcrypt-pbkdf": "^1.0.0",
"dashdash": "^1.12.0",
"ecc-jsbn": "~0.1.1",
"getpass": "^0.1.1",
"jsbn": "~0.1.0",
"safer-buffer": "^2.0.2",
"tweetnacl": "~0.14.0"
}
},
"tough-cookie": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
"integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
"optional": true,
"requires": {
"psl": "^1.1.28",
"punycode": "^2.1.1"
}
},
"tslib": {
"version": "1.13.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz",
"integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q=="
},
"tunnel-agent": {
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
"integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=",
"optional": true,
"requires": {
"safe-buffer": "^5.0.1"
}
},
"tweetnacl": {
"version": "0.14.5",
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
"integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=",
"optional": true
},
"uri-js": {
"version": "4.2.2",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz",
"integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==",
"optional": true,
"requires": {
"punycode": "^2.1.0"
}
},
"uuid": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"optional": true
},
"verror": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
"integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=",
"optional": true,
"requires": {
"assert-plus": "^1.0.0",
"core-util-is": "1.0.2",
"extsprintf": "^1.2.0"
}
}
}
}

25
package.json Normal file
View file

@ -0,0 +1,25 @@
{
"name": "sphinx_nervproject_theme",
"version": "1.0.0",
"description": "Sphinx Nerv Project Theme",
"main": "index.js",
"directories": {
"doc": "docs"
},
"scripts": {
"build:theme": "lessc --clean-css='--advanced' ui/theme.less sphinx_nervproject_theme/static/sphinx_nervproject_theme.css",
"build:weasyprint": "lessc --clean-css='--advanced' ui/theme-weasyprint.less sphinx_nervproject_theme/static/sphinx_nervproject_weasyprint.css",
"build:epub": "lessc --clean-css='--advanced' ui/theme-epub.less sphinx_nervproject_theme/static/sphinx_nervproject_epub.css",
"build": "npm run build:theme && npm run build:weasyprint && npm run build:epub"
},
"repository": {
"type": "git",
"url": "git@procrastinator.nerv-project.eu:nerv-project/communication/sphinx_nervproject_theme"
},
"author": "kujiu",
"license": "EUPL 1.2",
"dependencies": {
"less": "^3.11.3",
"less-plugin-clean-css": "^1.5.1"
}
}

View file

@ -22,12 +22,13 @@ class TranslateCommand(distutils.cmd.Command):
for cmd_name in self.get_sub_commands():
self.run_command(cmd_name)
with open("README.rst", "r") as fh:
long_description = fh.read()
setup(
name="sphinx_nervproject_theme",
version="1.0.8",
version="1.1.0",
url="https://procrastinator.nerv-project.eu/nerv-project/communication/sphinx_nervproject_theme",
license="EUPL 1.2",
author="Kujiu",
@ -36,7 +37,7 @@ setup(
long_description=long_description,
long_description_content_type="text/x-rst",
packages=["sphinx_nervproject_theme"],
cmdclass = {
cmdclass={
'translate': TranslateCommand,
},
package_data={

View file

@ -1,11 +1,15 @@
from os import path
import sys
from docutils import nodes
from sphinx.environment.collectors import EnvironmentCollector
from sphinx import addnodes
from sphinx.util.osutil import relative_uri
__version__ = (1, 0, 8)
__version__ = (1, 1, 0)
sys.setrecursionlimit(15000)
class SimpleTocTreeCollector(EnvironmentCollector):
@ -35,19 +39,15 @@ class SimpleTocTreeCollector(EnvironmentCollector):
for docname in docnames:
env.toc_dict[docname] = other.toc_dict[docname]
def process_doc(self, app, doctree):
docname = app.env.docname # sphinx mutates this, ouch!!!
# print(f"================ Collector\n{docname}\n============\n")
# get 1 level document toc (sections)
docname = app.env.docname
section_nodes = [s for s in doctree if isinstance(s, nodes.section)]
# if first level is a single section,
# ignore it and use second level of sections
if len(section_nodes) == 1:
section2_nodes = [s for s in section_nodes[0]
if isinstance(s, nodes.section)]
if section2_nodes: # do not replace with level-2 sections if None
if section2_nodes: # do not replace with level-2 sections if None
section_nodes = section2_nodes
sections = []
@ -63,7 +63,6 @@ class SimpleTocTreeCollector(EnvironmentCollector):
}
def add_toctree_data(app, pagename, templatename, context, doctree):
"""Create toctree_data, used to build sidebar navigation
@ -88,7 +87,7 @@ def add_toctree_data(app, pagename, templatename, context, doctree):
master = app.env.get_doctree(app.env.config.master_doc)
# each toctree will create navigation section
res = [] # list of top level toctrees in master_doc
res = [] # list of top level toctrees in master_doc
for tree in master.traverse(addnodes.toctree):
# special case for toctree that includes a single item
@ -101,7 +100,7 @@ def add_toctree_data(app, pagename, templatename, context, doctree):
for tree in toctrees:
pass
current0 = False # same page might have multiple tocs
current0 = False # same page might have multiple tocs
# add toc tree items, expand one more level if toctree is current page
entries = []
@ -123,7 +122,7 @@ def add_toctree_data(app, pagename, templatename, context, doctree):
'children': children,
})
toc_docname = tree['parent'] # docname where this toc appears
toc_docname = tree['parent'] # docname where this toc appears
title = tree['caption']
toc_caption = tree['caption']
@ -135,7 +134,7 @@ def add_toctree_data(app, pagename, templatename, context, doctree):
# First parent is "compound" node toctree-wrapper,
# second parent is the section containing the toctree
toc_section = tree.parent.parent
if toc_section['ids']: # no id means toc actually not in a section
if toc_section['ids']: # no id means toc actually not in a section
# TODO: should we be strict about toc being inside a section
anchor_id = toc_section['ids'][0]
if not title:
@ -157,10 +156,22 @@ def add_toctree_data(app, pagename, templatename, context, doctree):
context['toctree_data'] = res
def on_config_inited(app, conf):
exclude_files = list(app.config.get('epub_exclude_files', []))
exclude_files.append('_static/sphinx_nervproject_theme.js')
exclude_files.append('_static/sphinx_nervproject_simple.css')
exclude_files.append('_static/sphinx_nervproject_theme.css')
exclude_files.append('_static/basic.css')
app.config.exclude_files = exclude_files
app.config.weasyprint_footer_selector = 'footer.footer'
app.config.weasyprint_header_selector = 'header.navbar'
def setup(app):
app.add_env_collector(SimpleTocTreeCollector)
app.connect('html-page-context', add_toctree_data)
app.connect('config-inited', on_config_inited)
app.add_html_theme('nervproject', path.abspath(path.dirname(__file__)))
locale_path = path.join(path.abspath(path.dirname(__file__)), 'locale')

View file

@ -1,36 +1,41 @@
<!DOCTYPE html>
<html {% if language is not none %} lang="{{ language }}"{% endif %}>
<html {% if language is not none %} lang="{{ language }}"{% endif %}{% if builder=='epub' %} xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"{% endif%}>
<head>
<meta charset="{{ encoding }}">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta charset="{{ encoding }}"/>
<meta name="viewport" content="width=device-width,initial-scale=1" />
{{- metatags }}
{%- block htmltitle %}
<title>{{ title|striptags|e }}{{ titlesuffix }}</title>
{%- endblock %}
{# <meta name="description" content="{{ description }}"> #}
{# <meta name="description" content="{{ description }}"/> #}
{%- block css %}
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1)}}">
<link rel="stylesheet" href="{{ pathto('_static/theme.css', 1)}}">
<link rel="stylesheet" href="{{ pathto('_static/sphinx_nervproject_theme.css', 1)}}">
{% if theme_isso %}
<link rel="stylesheet" href="{{ pathto('_static/isso.css', 1)}}">
<script data-isso="{{ theme_isso['prefix'] }}"
data-isso-id="{{ pagename }}"
data-isso-css="false"
data-isso-lang="{{ theme_isso.get('lang', language) }}"
data-isso-reply-to-self="{{ theme_isso['reply_to_self'] }}"
data-isso-require-author="{{ theme_isso['require_author'] }}"
data-isso-require-email="{{ theme_isso['require_email'] }}"
data-isso-reply-notifications="{{ theme_isso['reply_notif'] }}"
data-isso-max-comments-top="{{ theme_isso['max_comments_top'] }}"
data-isso-max-comments-nested="{{ theme_isso['max_comments_nested'] }}"
data-isso-reveal-on-click="{{ theme_isso['reveal_on_click'] }}"
data-isso-avatar="{{ theme_isso['avatar'] }}"
data-isso-vote="{{ theme_isso['vote'] }}"
data-isso-vote-levels="{{ theme_isso['vote_levels'] }}"
data-isso-feed="{{ theme_isso['feed'] }}"
src="{{ theme_isso['url'] }}/js/embed.min.js"></script>
<style id="isso-style"></style>
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1)}}"/>
{% if builder=='weasyprint' %}
<link rel="stylesheet" href="{{ pathto('_static/sphinx_nervproject_weasyprint.css', 1)}}"/>
{% elif builder=='epub' %}
<link rel="stylesheet" href="{{ pathto('_static/sphinx_nervproject_epub.css', 1)}}"/>
{% else %}
<link rel="stylesheet" href="{{ pathto('_static/sphinx_nervproject_theme.css', 1)}}"/>
{% if theme_isso %}
<link rel="stylesheet" href="{{ pathto('_static/isso.css', 1)}}">
<script data-isso="{{ theme_isso['prefix'] }}"
data-isso-id="{{ pagename }}"
data-isso-css="false"
data-isso-lang="{{ theme_isso['lang'] }}"
data-isso-reply-to-self="{{ theme_isso['reply_to_self'] }}"
data-isso-require-author="{{ theme_isso['require_author'] }}"
data-isso-require-email="{{ theme_isso['require_email'] }}"
data-isso-reply-notifications="{{ theme_isso['reply_notif'] }}"
data-isso-max-comments-top="{{ theme_isso['max_comments_top'] }}"
data-isso-max-comments-nested="{{ theme_isso['max_comments_nested'] }}"
data-isso-reveal-on-click="{{ theme_isso['reveal_on_click'] }}"
data-isso-avatar="{{ theme_isso['avatar'] }}"
data-isso-vote="{{ theme_isso['vote'] }}"
data-isso-vote-levels="{{ theme_isso['vote_levels'] }}"
data-isso-feed="{{ theme_isso['feed'] }}"
src="{{ theme_isso['url'] }}/js/embed.min.js"></script>
<style id="isso-style"></style>
{% endif %}
{% endif %}
{%- for css in css_files %}
{%- if css|attr("rel") %}
@ -42,20 +47,22 @@
{%- endblock %}
{%- block scripts %}
{# FIXME: use link-preload #}
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
{% if theme_fathom %}
{%- include "util/fathom.html" %}
{% if builder=='html' %}
{# FIXME: use link-preload #}
<script type="text/javascript" id="documentation_options" data-url_root="{{ pathto('', 1) }}" src="{{ pathto('_static/documentation_options.js', 1) }}"></script>
{% if theme_fathom %}
{%- include "util/fathom.html" %}
{% endif %}
<!-- sphinx script_files -->
{%- for scriptfile in script_files %}
{{ js_tag(scriptfile) }}
{%- endfor %}
<script src="{{ pathto('_static/sphinx_nervproject_theme.js', 1)}}" defer></script>
<script src="{{ pathto('_static/sphinx_nervproject_theme.js', 1)}}" defer></script>
{% endif %}
<!-- sphinx script_files -->
{%- for scriptfile in script_files %}
{{ js_tag(scriptfile) }}
{%- endfor %}
{# press js #}
<script src="{{ pathto('_static/theme-vendors.js', 1)}}"></script>
<script src="{{ pathto('_static/theme.js', 1)}}" defer></script>
{%- endblock %}
{%- if pageurl %}
<link rel="canonical" href="{{ pageurl }}" />
@ -70,33 +77,31 @@
</head>
<body>
<div id="app" class="theme-container" :class="pageClasses">
<div id="app" class="theme-container">
{%- block container %}
{%- block header %}{%- include "util/navbar.html" %}{% endblock %}
{# close sidebar when clicked out of it #}
<div class="sidebar-mask" @click="toggleSidebar(false)">
</div>
<div id="appflex">
{%- block sidebar %}
<sidebar @toggle-sidebar="toggleSidebar">
{% if builder=='html' %}
<div class="sidebar" id="sidebar">
{# sidebar navlinks displayed only on mobile #}
<navlinks>
<nav class="nav-links can-hide">
{% block side_links %}
{%- include "util/navlinks.html" %}
{%- include "util/extlinks.html" %}
{% endblock %}
</navlinks>
</nav>
{%- if sidebars != None %}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{%- endif %}
</sidebar>
</div>
{% endif %}
{%- endblock %}
<page>
<div class="page">
{%- block document %}
{% block body_header %}
{%- include "util/bodyheader.html" %}
@ -105,7 +110,7 @@
{% block body %} {% endblock %}
</main>
{%- endblock %}
</page>
</div>
</div>
{%- block footer %}

View file

@ -2,40 +2,29 @@
{%- block extrahead %}
{{ super() }}
{% if feed_path %}
<link rel="alternate" type="application/atom+xml" href="{{ pathto(feed_path, 1) }}/atom.xml" title="{{ feed_title }}">
<link rel="alternate" type="application/atom+xml" href="{{ pathto(feed_path, 1) }}/atom.xml" title="{{ feed_title }}"/>
{% endif %}
{% endblock %}
{% block body %}
{{ body }}
<div class="section">
{% if ablog and pagename in ablog %}
{% include "postnavy.html" %}
{% include "share.html" %}
{% else %}
{% if ablog and theme_share_all %}
{% if builder=='html' %}
<div class="section">
{% if ablog and pagename in ablog %}
{% include "postnavy.html" %}
{% include "share.html" %}
{% else %}
{% if ablog and theme_share_all %}
{% include "share.html" %}
{% endif %}
{% endif %}
{% if ablog and ablog.disqus_shortname and ablog.blog_baseurl and
(not ablog[pagename].nocomments) and
((pagename in ablog and (ablog[pagename].published or
ablog.disqus_drafts)) or
(not pagename in ablog and ablog.disqus_pages)) %}
{% include "util/disqus.html" %}
{% endif %}
</div>
{% endif %}
{% if ablog and ablog.disqus_shortname and ablog.blog_baseurl and
(not ablog[pagename].nocomments) and
((pagename in ablog and (ablog[pagename].published or
ablog.disqus_drafts)) or
(not pagename in ablog and ablog.disqus_pages)) %}
{% include "util/disqus.html" %}
{% endif %}
{% if ablog and theme_isso and
(not ablog[pagename].nocomments) and
((pagename in ablog and (ablog[pagename].published or
ablog.disqus_drafts)) or
(not pagename in ablog and ablog.disqus_pages)) %}
<section class="comments" id="comments">
<h2 class="panel">{{ _("Comments") }}</h2>
<section id="isso-thread"
data-isso-id="{{ pagename }}"
data-title="{{ title }}"
></section>
</section>
{% endif %}
</div>
{% endblock %}

View file

@ -1,6 +1,6 @@
<section>
{% set post = ablog[pagename] %}
<div class="center social-share">
<div class="center social-share no-print">
<p>{{ gettext('Like this article? Share it!') }}</p>
<ul class="social">
<li>

View file

@ -1,4 +1,4 @@
<div class="sidebar-links">
<div class="sidebar-links no-print">
<div class="sidebar-group">
<ul class="social">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,13 @@
function toggleSidebar() {
document.querySelector('#sidebar').toggleAttribute('opened');
}
const buttonToggle = document.querySelector('button.sidebar-button');
buttonToggle.addEventListener('click', event => {
toggleSidebar();
});
buttonToggle.addEventListener('keydown', event => {
if(event.keyCode === 13 || event.keyCode === 32 ) {
toggleSidebar();
}
});

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
../../ui/dist/js/chunk-vendors.js

View file

@ -1 +0,0 @@
../../ui/dist/css/app.css

View file

@ -1 +0,0 @@
../../ui/dist/js/app.js

View file

@ -5,7 +5,7 @@
{% else %}
{% trans copyright=copyright|e %}&#169; Copyright {{ copyright }}.{% endtrans %}
{% endif %}
<br>
<br/>
{% endif %}
{% if theme_license['type'] == "CC" %}
<a href="{{ theme_license.url }}">
@ -44,4 +44,5 @@
based on <a href="https://github.com/schettino72/sphinx_press_theme">Press Theme</a>
and <a href="https://ablog.readthedocs.io/">ABlog</a>.{% endtrans %}
{% endif %}
<div class="pagecount"></div>
</footer>

View file

@ -1,12 +1,28 @@
<navbar @toggle-sidebar="toggleSidebar">
<header class="navbar">
<div id="header-identity" class="print-only">
<img id="navbar_logo" src="{{ pathto('_static/' + logo, 1) }}"/>
<div id="navbar_title">{{ html_title }}</div>
</div>
{% if builder=='html' %}
<button class="sidebar-button">
<svg id="sidebar-button-svg" role="img" aria-labelledby="sidebar-button_label">
<title id="sidebar-button_label">
{{ gettext('Toggle sidebar') }}
</title>
<use xlink:href="{{ pathto('_static/fa/solid.svg', 1) }}#bars"></use>
</svg>
</button>
<a href="{{pathto(master_doc)}}" class="home-link">
<span class="site-name">{{ project|e }}</span>
</a>
<div class="links">
<navlinks class="can-hide">
<div class="nav-links can-hide">
{%- include "util/navlinks.html" %}
{%- include "util/extlinks.html" %}
</navlinks>
</div>
</div>
<router-link to="{{pathto(master_doc)}}" class="home-link">
<span class="site-name">{{ project|e }}</span>
</router-link>
</navbar>
{% endif %}
</header>

View file

@ -4,7 +4,7 @@
<details>
<summary>
<span
class="nav-link {% if tree.current %} router-link-active{% endif %}">
class="nav-link {% if tree.current %} link-active{% endif %}">
{{tree.title}}
</span>
</summary>

21
ui/.gitignore vendored
View file

@ -1,21 +0,0 @@
.DS_Store
node_modules
/dist
# local env files
.env.local
.env.*.local
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw*

View file

@ -1,21 +0,0 @@
# ui
## Project setup
```
npm install
```
### Compiles and hot-reloads for development
```
npm run serve
```
### Compiles and minifies for production
```
npm run build
```
### Lints and fixes files
```
npm run lint
```

View file

@ -1,5 +1,3 @@
@import './config.less';
.arrow {
display: inline-block;
width: 0;
@ -7,21 +5,21 @@
&.up {
border-left: 0.3rem solid transparent;
border-right: 0.3rem solid transparent;
border-bottom: 0.5rem solid var(--ArBgClr);
border-bottom: 0.5rem solid @ArBgClr;
}
&.down {
border-left: 0.3rem solid transparent;
border-right: 0.3rem solid transparent;
border-top: 0.5rem solid var(--ArBgClr);
border-top: 0.5rem solid @ArBgClr;
}
&.right {
border-top: 0.3rem solid transparent;
border-bottom: 0.3rem solid transparent;
border-left: 0.5rem solid var(--ArBgClr);
border-left: 0.5rem solid @ArBgClr;
}
&.left {
border-top: 0.3rem solid transparent;
border-bottom: 0.3rem solid transparent;
border-right: 0.5rem solid var(--ArBgClr);
border-right: 0.5rem solid @ArBgClr;
}
}

View file

@ -1,5 +0,0 @@
module.exports = {
presets: [
'@vue/app'
]
}

View file

@ -1,41 +1,54 @@
@import './config.less';
pre {
white-space: pre-wrap;
overflow-wrap: break-word;
}
.content {
td.linenos, td.code {
border: none;
padding: 0;
margin: 0;
> .highlight pre {
border: none;
}
}
code {
color: var(--CdTClr);
padding: 0.25rem 0.5rem;
color: @CdTClr;
padding: 0.25rem 0.1rem;
margin: 0;
font-size: 0.85em;
background-color: var(--CdBgClr);
border-radius: 0.2em;
border-color: var(--CdBClr);
background-color: @CdBgClr;
border-bottom: @CdBClr solid 0.2em;
a, a:visited {
color: var(--CdLClr);
color: @CdLClr;
&:hover {
color: var(--CdLHClr);
color: @CdLHClr;
}
}
}
td.linenos pre {
background-color: @CdBClr;
white-space: pre;
overflow-wrap: normal;
}
pre, pre[class*="language-"] {
line-height: 1.4;
padding: 1.25rem 1.5rem;
margin: 0.85rem 0;
background-color: var(--PrBgClr);
color: var(--PrTClr);
border-radius: 0.5rem;
border-color: var(--PrBClr);
overflow: auto;
background-color: @PrBgClr;
color: @PrTClr;
border-left: @PrBClr solid 0.5em;
code {
color: var(--PrTClr);
color: @PrTClr;
padding: 0;
background-color: transparent;
border-radius: 0;
}
a, a:visited {
color: var(--PrLClr);
color: @PrLClr;
&:hover {
color: var(--PrLHClr);
color: @PrLHClr;
}
}
}
@ -43,19 +56,14 @@
div[class*="language-"] {
position: relative;
background-color: var(--CdBgClr);
border-radius: 0.5rem;
background-color: @CdBgClr;
.highlight-lines {
user-select: none;
padding-top: 1.3rem;
position: absolute;
top: 0;
left: 0;
width: 100%;
line-height: 1.4;
.highlighted {
background-color: var(--CdBgAClr);
color: var(--CdAClr);
background-color: @CdBgAClr;
color: @CdAClr;
}
}
pre, pre[class*="language-"] {
@ -64,12 +72,9 @@ div[class*="language-"] {
z-index: 1;
}
&::before {
position: absolute;
z-index: 3;
top: 0.8em;
right: 1em;
font-size: 0.75rem;
color: hsla(var(--CdTClr-h), var(--CdTClr-s), var(--CdTClr-l), 0.4);
color: @CdT2Clr;
}
&:not(.line-numbers-mode) {
.line-numbers-wrapper {
@ -82,51 +87,38 @@ div[class*="language-"] {
position: relative;
&:before {
content: ' ';
position: absolute;
z-index: 3;
left: 0;
top: 0;
display: block;
width: var(--lineNumbersWrapperWidth);
width: @lineNumbersWrapperWidth;
height: 100%;
background-color: var(--CdBgAClr);
color: var(--CdBgClr);
background-color: @CdBgAClr;
color: @CdBgClr;
}
}
}
pre {
padding-left: calc(var(--lineNumbersWrapperWidth) + 1rem);
padding-left: @lineNumbersWrapperWidth;
vertical-align: middle;
}
.line-numbers-wrapper {
position: absolute;
top: 0;
width: var(--lineNumbersWrapperWidth);
width: @lineNumbersWrapperWidth;
text-align: center;
color: hsla(var(--PrTClr-h), var(--PrTClr-s), var(--PrTClr-l), 0.3);
color: @PrLNClr;
padding: 1.25rem 0;
line-height: 1.4;
br {
user-select: none;
}
.line-number {
position: relative;
z-index: 4;
user-select: none;
font-size: 0.85em;
}
}
&::after {
content: '';
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: var(--lineNumbersWrapperWidth);
width: @lineNumbersWrapperWidth;
height: 100%;
border-radius: 0.5rem 0 0 0.5rem;
border-right: 0.1rem solid hsla(var(--PrBClr-h), var(--PrBClr-s), var(--PrBClr-l), 66%);
background-color: var(--PrBgClr);
border-left: 0.5rem solid @PrB2Clr;
background-color: @PrBgClr;
}
}
}

772
ui/common.less Normal file
View file

@ -0,0 +1,772 @@
@import './code.less';
@import './custom-blocks.less';
@import './arrow.less';
@import './sphinx.less';
@import './toc.less';
@font-face {
font-family: Hack;
font-weight: normal;
font-style: normal;
src: url("fonts/hack/Hack-Regular.ttf");
}
@font-face {
font-family: Hack;
font-weight: bold;
font-style: normal;
src: url("fonts/hack/Hack-Bold.ttf");
}
@font-face {
font-family: Hack;
<