From a167c8bcb4703975edac9f33410a614dcafcbd00 Mon Sep 17 00:00:00 2001 From: Kristinita Date: Sat, 6 Mar 2021 08:38:57 +0300 Subject: [PATCH] =?UTF-8?q?fix(pipenv):=20temporary=20add=20=E2=80=9Csourc?= =?UTF-8?q?e=E2=80=9D=20Pipfile=20section=20=E2=80=94=20https://github.com?= =?UTF-8?q?/pypa/pipenv/issues/4141#issuecomment-728788437?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit upd(markdown): markdown_link_attr_modifier new options — https://github.com/Phuker/markdown_link_attr_modifier#options https://travis-ci.com/github/Kristinita/KristinitaPelican/jobs/488591513#L808-L874 https://ci.appveyor.com/project/Kristinita/kristinitapelican/builds/38086144/job/5j6tifeghl3al9d8#L360 fix(grunt): temporary disable checkPages due to “Fatal error: Maximum call stack size exceeded” --- Pipfile | 5 + grunt/aliases.yaml | 1 - grunt/concurrent.coffee | 8 +- grunt/shell.coffee | 208 +++++++++++------- pelican-config/markdown_plugins_settings.yaml | 36 +-- 5 files changed, 160 insertions(+), 98 deletions(-) diff --git a/Pipfile b/Pipfile index 4ed33f2b..5c5e9808 100644 --- a/Pipfile +++ b/Pipfile @@ -1,3 +1,8 @@ +[[source]] +url = "https://pypi.python.org/simple" +verify_ssl = true +name = "pypi" + [dev-packages] pelican = "*" markdown = "*" diff --git a/grunt/aliases.yaml b/grunt/aliases.yaml index 4b09dcea..27adc3ec 100644 --- a/grunt/aliases.yaml +++ b/grunt/aliases.yaml @@ -89,7 +89,6 @@ validate: validatedev: - 'concurrent:tard1' - 'concurrent:tard2' -- 'concurrent:tard3' # [INFO] Continuous integration, not local remote: diff --git a/grunt/concurrent.coffee b/grunt/concurrent.coffee index 55c8e05d..5d47705f 100644 --- a/grunt/concurrent.coffee +++ b/grunt/concurrent.coffee @@ -201,14 +201,20 @@ module.exports = ### tard1: ['clean-console'] + ### + [FIXME] I get “Fatal error: Maximum call stack size exceeded” + when CheckPages checks the file “Библиотека-непрерывного-обучения.html” + tard2: ['checkPages'] + ### + ### [FIXME] pageres doesn’t work with grunt-critical: https://github.com/bezoerb/grunt-critical/issues/65 tard3: ['pageres'] ### - tard3: ['notify:validate'] + tard2: ['notify:validate'] ### diff --git a/grunt/shell.coffee b/grunt/shell.coffee index 56b7e210..53a7e31b 100644 --- a/grunt/shell.coffee +++ b/grunt/shell.coffee @@ -1,60 +1,73 @@ ################# ## grunt-shell ## ################# -# [PURPOSE] Grunt plugin to run non-Grunt CLI commands. -# https://www.npmjs.com/package/grunt-shell +### +[PURPOSE] Grunt plugin to run non-Grunt CLI commands. +https://www.npmjs.com/package/grunt-shell +### module.exports = ############# ## Pelican ## ############# - # Build Pelican site: - # http://manos.im/blog/static-site-pelican-grunt-travis-github-pages/ - # https://github.com/sindresorhus/grunt-shell - # [REQUIRED] “pipenv run”, that scripts from pipenv virtual environment successful run; - # for example, “pipenv run pelican --help”, not “pelican --help”. - # https://robots.thoughtbot.com/how-to-manage-your-python-projects-with-pipenv - # “--fatal” — exit(1), if any warning or error + ### + Build Pelican site: + http://manos.im/blog/static-site-pelican-grunt-travis-github-pages/ + https://github.com/sindresorhus/grunt-shell + [REQUIRED] “pipenv run”, that scripts from pipenv virtual environment successful run; + for example, “pipenv run pelican --help”, not “pelican --help”. + https://robots.thoughtbot.com/how-to-manage-your-python-projects-with-pipenv + “--fatal” — exit(1), if any warning or error + ### generate: command: 'pipenv run pelican content -s pelicanconf.py --fatal warnings --debug' deploy: command: 'pipenv run pelican content -s publishconf.py --fatal warnings --debug' - - # [DEPRECATED] If “pipenv --update”, users have bug: - # https://github.com/pypa/pipenv/issues/1761 - # # Update Pip and Pipenv - # pipenvupdate: - # command: 'pipenv --update' + ### + [DEPRECATED] If “pipenv --update”, users have bug: + https://github.com/pypa/pipenv/issues/1761 + # Update Pip and Pipenv + pipenvupdate: + command: 'pipenv --update' + ### ############ ## pipenv ## ############ - # [INFO] Update all Python Pipenv packages: - # https://stackoverflow.com/a/16269635/5951529 - # https://github.com/jgonggrijp/pip-review#pip-review + ### + [INFO] Update all Python Pipenv packages: + https://stackoverflow.com/a/16269635/5951529 + https://github.com/jgonggrijp/pip-review#pip-review + ### pipenvupdateall: command: 'pipenv run pip-review --auto' ### [INFO] Clean unused packages: https://pipenv.pypa.io/en/latest/cli/#pipenv-clean + [NOTE] So that “pipenv clean” doesn’t remove Python Markdown git extensions, you need install them in format: “pipenv install -e git+https://github.com/user/package_name.git#egg=package_name --dev”: https://pipenv.pypa.io/en/latest/basics/#a-note-about-vcs-dependencies https://github.com/pypa/pipenv/issues/1524 + This is “editable” format: http://pipenv.readthedocs.io/en/latest/basics/#editable-dependencies-e-g-e + [NOTE] Use correct “package_name” for “editable” packages, so that “pipenv clean” doesn’t delete them: https://github.com/pypa/pipenv/issues/1524#issuecomment-695213982 ### pipenvcleanunused: command: 'pipenv clean --verbose' - # Update packages versions to the newest in “Pipfile.lock”, that: - # 1. Another users have newest packages versions in their environment: - # 2. Fix CI errors as https://travis-ci.org/Kristinita/KristinitaPelican/jobs/368968779#L658-L677 - # https://docs.pipenv.org/basics/#example-pipenv-upgrade-workflow + ### + Update packages versions to the newest in “Pipfile.lock”, that: + + 1. Another users have newest packages versions in their environment: + 2. Fix CI errors as https://travis-ci.org/Kristinita/KristinitaPelican/jobs/368968779#L658-L677 + https://docs.pipenv.org/basics/#example-pipenv-upgrade-workflow + ### pipenvupdatepipfilelock: command: 'pipenv update --verbose' @@ -62,19 +75,23 @@ module.exports = ######### ## git ## ######### - # Shrink .git folder - # https://stackoverflow.com/a/2116892/5951529 - # Before: 568 MB — - # After: 341 MB — - ######### - # Remove reflog entries older, than 90 days: - # https://stackoverflow.com/a/3824970/5951529 + ### + Shrink .git folder + https://stackoverflow.com/a/2116892/5951529 + Before: 568 MB — + After: 341 MB — + + Remove reflog entries older, than 90 days: + https://stackoverflow.com/a/3824970/5951529 + ### gitreflog: command: 'git reflog expire --all' - # git gc - # https://stackoverflow.com/a/55738/5951529 - # Prune loose objects older than 2 weeks ago: - # https://www.kernel.org/pub/software/scm/git/docgit-gc.html + ### + git gc + https://stackoverflow.com/a/55738/5951529 + Prune loose objects older than 2 weeks ago: + https://www.kernel.org/pub/software/scm/git/docgit-gc.html + ### gitgarbagecollector: command: 'git gc --aggressive' @@ -82,21 +99,27 @@ module.exports = ############### ## HTML Tidy ## ############### - # Validate and fix HTML files: - # http://www.html-tidy.org/ - # Description: - # http://api.html-tidy.org/tidy/tidylib_api_next/index.html - # Options: - # http://api.html-tidy.org/tidy/quickref_next.html + ### + Validate and fix HTML files: + http://www.html-tidy.org/ + Description: + http://api.html-tidy.org/tidy/tidylib_api_next/index.html + Options: + http://api.html-tidy.org/tidy/quickref_next.html + ### tidymodify: - # [LEARN][GRUNT] Platform-specific tasks: - # https://stackoverflow.com/a/23848087/5951529 + ### + [LEARN][GRUNT] Platform-specific tasks: + https://stackoverflow.com/a/23848087/5951529 + ### if process.platform is "win32" # Need quotes, that command run: command: '"batch/tidy-modify.bat"' else - # [NOTE] Fix permission denied: - # https://stackoverflow.com/a/46818913/5951529 + ### + [NOTE] Fix permission denied: + https://stackoverflow.com/a/46818913/5951529 + ### command: 'bash bash/tidy-modify.sh' tidyvalidate: if process.platform is "win32" @@ -108,20 +131,25 @@ module.exports = ############ ## covgen ## ############ - # Generate Code of conduct for project: - # https://contributor-covenant.org/ - # https://www.npmjs.com/package/covgen - # [WARNING] Generate “CODE_OF_CONDUCT.md” for root folder: - # https://github.com/simonv3/covenant-generator/issues/15 - # [WARNING] Unobfuscated plain text e-mail: - # https://github.com/ContributorCovenant/contributor_covenant/issues/523 + ### + Generate Code of conduct for project: + https://contributor-covenant.org/ + https://www.npmjs.com/package/covgen + [WARNING] Generate “CODE_OF_CONDUCT.md” for root folder: + https://github.com/simonv3/covenant-generator/issues/15 + [WARNING] Unobfuscated plain text e-mail: + https://github.com/ContributorCovenant/contributor_covenant/issues/523 + ### + ######### ## npx ## ######### - # Tool for running npm CLI commands: - # https://www.npmjs.com/package/npx - # https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b - # https://stackoverflow.com/a/45164863/5951529 + ### + Tool for running npm CLI commands: + https://www.npmjs.com/package/npx + https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b + https://stackoverflow.com/a/45164863/5951529 + ### covgen: command: 'npx covgen kristinita$cock.li' @@ -129,10 +157,12 @@ module.exports = ################## ## pip-licenses ## ################## - # Output licenses of all PyPI packages: - # https://pypi.org/project/pip-licenses/ - # Options: - # https://pypi.org/project/pip-licenses/#command-line-options + ### + Output licenses of all PyPI packages: + https://pypi.org/project/pip-licenses/ + Options: + https://pypi.org/project/pip-licenses/#command-line-options + ### piplicenses: command: 'pipenv run pip-licenses --with-authors --with-urls --with-description --format=markdown > python.md' @@ -140,8 +170,10 @@ module.exports = ########################## ## commitlint Travis CI ## ########################## - # Commit linting for Travis CI: - # http://marionebl.github.io/commitlint/#/guides-ci-setup + ### + Commit linting for Travis CI: + http://marionebl.github.io/commitlint/#/guides-ci-setup + ### commitlint: command: 'commitlint-travis' @@ -163,18 +195,20 @@ module.exports = ########## # EClint # ########## - # Lint and fix files for EditorConfig rules: - # https://www.npmjs.com/package/eclint - # eclint doesn't search files and folders, that ignored in “.gitignore”: - # https://github.com/jedmao/eclint/issues/80#issuecomment-314936365 - # “eclint infer” — show current statistic: - # https://www.npmjs.com/package/eclint#infer - # [WARNING] Another eclint check and fix methods doesn't work: - # https://github.com/jedmao/eclint/issues/130 - # [WARNING] User can get different results for Windows and *NIX: - # https://github.com/jedmao/eclint/issues/129#event-1574600632 - # [BUG] 2 blank lines in end of file “CODE_OF_CONDUCT.md”, needs fix it: - # https://github.com/ContributorCovenant/contributor_covenant/issues/528 + ### + Lint and fix files for EditorConfig rules: + https://www.npmjs.com/package/eclint + eclint doesn't search files and folders, that ignored in “.gitignore”: + https://github.com/jedmao/eclint/issues/80#issuecomment-314936365 + “eclint infer” — show current statistic: + https://www.npmjs.com/package/eclint#infer + [WARNING] Another eclint check and fix methods doesn't work: + https://github.com/jedmao/eclint/issues/130 + [WARNING] User can get different results for Windows and *NIX: + https://github.com/jedmao/eclint/issues/129#event-1574600632 + [BUG] 2 blank lines in end of file “CODE_OF_CONDUCT.md”, needs fix it: + https://github.com/ContributorCovenant/contributor_covenant/issues/528 + ### eclintfix: command: "npx eclint fix CODE_OF_CONDUCT.md && cd <%= templates.yamlconfig.OUTPUT_PATH %> \ && npx eclint fix && cd <%= templates.paths.cwd %>" @@ -185,8 +219,10 @@ module.exports = ##################### # license-generator # ##################### - # Generate license: - # https://www.npmjs.com/package/license-generator + ### + Generate license: + https://www.npmjs.com/package/license-generator + ### licensegenerator: command: "npx license-generator install mit -n \"Sasha Chernykh\"" @@ -194,8 +230,10 @@ module.exports = ############## # ShellCheck # ############## - # Check “.sh” files: - # https://www.shellcheck.net/ + ### + Check “.sh” files: + https://www.shellcheck.net/ + ### shellcheck: if process.platform is "win32" command: '"batch/shellcheck.bat"' @@ -206,8 +244,10 @@ module.exports = ########### # bashate # ########### - # Check “.sh” files: - # https://docs.openstack.org/bashate/latest/readme + ### + Check “.sh” files: + https://docs.openstack.org/bashate/latest/readme + ### bashate: if process.platform is "win32" command: '"batch/bashate.bat"' @@ -218,10 +258,12 @@ module.exports = ################# # LocalAppVeyor # ################# - # Validate “appveyor.yml” file: - # https://github.com/joaope/LocalAppVeyor - # [INFO] Get system environment variables: - # https://stackoverflow.com/a/14089064/5951529 - # https://gruntjs.com/creating-tasks#cli-options-environment + ### + Validate “appveyor.yml” file: + https://github.com/joaope/LocalAppVeyor + [INFO] Get system environment variables: + https://stackoverflow.com/a/14089064/5951529 + https://gruntjs.com/creating-tasks#cli-options-environment + ### localappveyor: command: "LocalAppVeyor lint --token <%= templates.tokens.api_key_appveyor %>" diff --git a/pelican-config/markdown_plugins_settings.yaml b/pelican-config/markdown_plugins_settings.yaml index 0f1e34d4..902be59c 100644 --- a/pelican-config/markdown_plugins_settings.yaml +++ b/pelican-config/markdown_plugins_settings.yaml @@ -166,15 +166,20 @@ MARKDOWN: # https://github.com/Phuker/markdown_link_attr_modifier#options markdown_link_attr_modifier: - # [INFO] Add “target="_blank"” to all external links: - new_tab: true + # [DEPRECATED] Old options names: + # new_tab: true + # external_only: true + # [INFO] Add “target="_blank"” and “rel="noopener"” to all external links: - # [INFO] Add attributes below for external links solely - external_only: true + # [INFO] “target="_blank"” without “rel="noopener"” is unsafe and may decrease performance: + # https://web.dev/external-anchors-use-rel-noopener/ + # https://mathiasbynens.github.io/rel-noopener/ + # https://www.reliablesoft.net/noreferrer-noopener/#noopener + new_tab: external_only - # [INFO] Disable default values: “referrerpolicy="noreferrer"” - # and “rel="noopener noreferrer"” - security: false + # [DEPRECATED] Old option name: + # security: false + # [INFO] Disable values: “referrerpolicy="noreferrer"” and “rel="noreferrer"” # [INFO] I have a static site; any private information will not show to external site owners: # https://web.dev/referrer-best-practices/ @@ -191,12 +196,17 @@ MARKDOWN: # [INFO] I don’t want to use “nofollow”. I find the sites I link to are usually good. # I see nothing wrong with increasing their SEO ranking - custom_attrs: - # [INFO] “target="_blank"” without “rel="noopener"” is unsafe and may decrease performance: - # https://web.dev/external-anchors-use-rel-noopener/ - # https://mathiasbynens.github.io/rel-noopener/ - # https://www.reliablesoft.net/noreferrer-noopener/#noopener - rel: noopener + no_referrer: off + + # [ACTION] Add the same “title” attribute as text in the link. + # Set “off” value because it's redundant: + # https://blog.pope.tech/2018/08/09/results-icon-dictionary/#title_redundant + auto_title: off + + # [DEPRECATED] + # Isn’t required for markdown_link_attr_modifier 0.2.0 + # custom_attrs: + # rel: noopener # [DECLINED]