Skip to content

Commit

Permalink
Merge branch 'dev' of github.com:Riverside-Healthcare/djLint into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherpickering committed Dec 15, 2022
2 parents e7c904e + af890c2 commit ddb3da0
Show file tree
Hide file tree
Showing 42 changed files with 8,083 additions and 6,329 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/linkcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Linkcheck
on: [push]
jobs:
linkcheck:
name: Linkcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x

- name: npm install, build
run: |
cd docs
npm install
npm run build
- uses: untitaker/[email protected]
with:
args: docs/_site/
23 changes: 22 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ jobs:
- name: Setup Poetry
uses: snok/install-poetry@v1

- name: Update wheels in docs demo
run: |
# remove old wheels
rm -f docs/src/static/py/*
# build new wheels
poetry run pip wheel . -w docs/src/static/py
# rename wheels
cd docs/src/static/py
mv djlint* djlint-99-py3-none-any.whl
mv click* click-99-py3-none-any.whl
mv colorama* colorama-99-py3-none-any.whl
mv cssbeautifier* cssbeautifier-99-py3-none-any.whl
mv EditorConfig* EditorConfig-99-py3-none-any.whl
mv html_tag_names* html_tag_names-99-py3-none-any.whl
mv html_void_elements* html_void_elements-99-py3-none-any.whl
mv importlib_metadata* importlib_metadata-99-py3-none-any.whl
mv jsbeautifier* jsbeautifier-99-py3-none-any.whl
mv pathspec* pathspec-99-py3-none-any.whl
mv PyYAML* PyYAML-99-py3-none-any.whl
mv zipp* zipp-99-py3-none-any.whl
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3

Expand All @@ -42,6 +63,6 @@ jobs:

- name: Build and publish package
if: steps.semantic.outputs.new_release_published == 'true'
uses: JRubics/poetry-publish@v1.13
uses: JRubics/poetry-publish@v1.15
with:
pypi_token: ${{ secrets.PYPI_API_TOKEN }}
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ exclude: >
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- repo: https://github.com/myint/autoflake
rev: v1.7.7
rev: v2.0.0
hooks:
- id: autoflake
exclude: &fixtures tests/functional/|tests/input|tests/extensions/data|tests/regrtest_data/|tests/data/
Expand All @@ -22,7 +22,7 @@ repos:
- --remove-duplicate-keys
- --remove-unused-variables
- repo: https://github.com/asottile/pyupgrade
rev: v3.2.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py36-plus]
Expand All @@ -33,11 +33,11 @@ repos:
exclude: docs*
additional_dependencies: [toml]
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.4.0
rev: v2.5.0
hooks:
- id: pretty-format-ini
args: [--autofix]
Expand Down
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"prepareCmd" : "poetry version ${nextRelease.version}"
}],
["@semantic-release/git", {
"assets": ["package.json", "pyproject.toml"]
"assets": ["package.json", "pyproject.toml", "docs"]
}],
"@semantic-release/github"
]
Expand Down
32 changes: 32 additions & 0 deletions docs/.eleventy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const outdent = require('outdent');
const schema = require('@quasibit/eleventy-plugin-schema');
const editOnGithub = require('eleventy-plugin-edit-on-github');
const i18n_func = require('eleventy-plugin-i18n/i18n.js');
const rollupper = require('./src/_utils/rollupper');
const { nodeResolve } = require('@rollup/plugin-node-resolve');

const slugifyCustom = (s) =>
slugify(s, { lower: true, remove: /[*+~.()'"!:@]/g });
Expand Down Expand Up @@ -93,6 +95,15 @@ module.exports = function (eleventyConfig) {
eleventyConfig.addPlugin(metagen);
eleventyConfig.addPlugin(criticalCss);
eleventyConfig.addPlugin(schema);
eleventyConfig.addPlugin(rollupper, {
rollup: {
output: {
format: 'umd',
dir: '_site/static/js',
},
plugins: [nodeResolve()],
},
});
eleventyConfig.addPlugin(editOnGithub, {
// required
github_edit_repo: 'https://github.com/Riverside-Healthcare/djLint',
Expand Down Expand Up @@ -190,6 +201,16 @@ module.exports = function (eleventyConfig) {
'src/static/img/favicon.ico': 'favicon.ico',
});

// copy wheels
eleventyConfig.addPassthroughCopy({
'src/static/py': 'static/py',
});

// copy python
eleventyConfig.addPassthroughCopy({
'src/static/js/worker.js': 'static/js/worker.js',
});

eleventyConfig.addFilter('jsonify', (text) => {
return JSON.stringify(text).replace(/(?:\\n\s*){2,}/g, '\\n');
});
Expand All @@ -203,6 +224,15 @@ module.exports = function (eleventyConfig) {
}
});

eleventyConfig.addFilter('year', (value) => {
try {
const options = { year: 'numeric' };
return value.toLocaleDateString('en-us', options);
} catch (e) {
return value;
}
});

eleventyConfig.addFilter('algExcerpt', (text) => {
return text
.replace(/<code class="language-.*?">.*?<\/code>/gs, '')
Expand Down Expand Up @@ -244,6 +274,8 @@ module.exports = function (eleventyConfig) {
'infinity',
'download',
'code-commit',
'spinner',
'circle-question',
],
},
'_site/static/font/fontawesome/webfonts',
Expand Down
Loading

0 comments on commit ddb3da0

Please sign in to comment.