reformatted

This commit is contained in:
Christopher Pickering 2022-01-24 09:03:25 -06:00
parent 583cee807c
commit 6465f709d1
No known key found for this signature in database
GPG key ID: E14DB3B0A0FACF84
36 changed files with 2334 additions and 574 deletions

45
.github/workflows/cron-run.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: Build and Release [Weekly]
on:
schedule:
- cron: 0 0 * * 0
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
with:
fetch-depth: '0'
- name: Update npm packages
run: |
cd docs
npm install
npm update --save/--save-dev
- name: npm format
run: |
cd docs
npm run format
- name: Update python deps
run: |
pip install poetry-up
poetry-up --install
- name: python format
run: tox -e isort,black
# - name: Stage, commit and push files
# uses: stefanzweifel/git-auto-commit-action@v4
# with:
# commit_user_name: "djlint-bot"
# commit_user_email: "djlint-bot@users.noreply.github.com"
# commit_author: "djlint-bot <djlint-bot@users.noreply.github.com>"
# commit_message: "chore(build): update packages [Weekly]"
# continue-on-error: true

View file

@ -1,21 +0,0 @@
name: docs
on:
release:
types: [published]
workflow_dispatch:
jobs:
move_to_branch:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: publish
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
publish_branch: netlify

3
docs/.prettierignore Normal file
View file

@ -0,0 +1,3 @@
src/static/**/*.md
src/static/**/*.html
_site/*

11
docs/.prettierrc Normal file
View file

@ -0,0 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"trailingComma": "all",
"bracketSpacing": true,
"arrowParens": "always",
"jsxBracketSameLine": false,
"semi": true
}

1532
docs/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,8 @@
"scripts": {
"start": "eleventy --serve --watch",
"install": "ELEVENTY_PRODUCTION=true eleventy",
"updateSearch": "node ./src/search/update-algolia-index.js"
"updateSearch": "node ./src/search/update-algolia-index.js",
"format": "prettier --config .prettierrc \"src/**/*.{ts,css,less,scss,js,json,md,yaml,html}\" --write"
},
"keywords": [],
"author": "Christopher Pickering",
@ -37,6 +38,9 @@
"cssnano": "^5.0.15",
"eleventy-plugin-metagen": "^1.4.0",
"esbuild": "^0.14.11",
"eslint": "^8.7.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.25.4",
"fontawesome-subset": "^3.0.0",
"html-minifier": "^4.0.0",
"markdown-it": "^12.3.2",
@ -46,6 +50,7 @@
"outdent": "^0.8.0",
"postcss-cli": "^9.1.0",
"postcss-nested": "^5.0.6",
"prettier": "^2.5.1",
"prismjs": "^1.26.0",
"sass": "^1.48.0",
"slugify": "^1.6.4"

View file

@ -1,24 +1,22 @@
module.exports = {
type: data => "page",
meta: {
site: {
name: data => data.site.title,
description: data => data.site.description,
url: data => data.site.url,
logo: {
src: data => data.site.image,
}
type: (data) => 'page',
meta: {
site: {
name: (data) => data.site.title,
description: (data) => data.site.description,
url: (data) => data.site.url,
logo: {
src: (data) => data.site.image,
},
language: data => "en-US",
url: data => data.site.url + data.page.url,
title: data => data.title || data.site.title,
description: data => data.description || data.site.description,
image: {
src: data => data.page.image
},
modified: data => data.page.date.toISOString(),
keywords: data => data.keywords
}
},
language: (data) => 'en-US',
url: (data) => data.site.url + data.page.url,
title: (data) => data.title || data.site.title,
description: (data) => data.description || data.site.description,
image: {
src: (data) => data.page.image,
},
modified: (data) => data.page.date.toISOString(),
keywords: (data) => data.keywords,
},
};

View file

@ -1,13 +1,13 @@
const htmlmin = require("html-minifier");
const htmlmin = require('html-minifier');
module.exports = function(content, outputPath) {
if( outputPath.endsWith(".html") ) {
module.exports = function (content, outputPath) {
if (outputPath.endsWith('.html')) {
let minified = htmlmin.minify(content, {
useShortDoctype: true,
removeComments: true,
collapseWhitespace: true
collapseWhitespace: true,
});
return minified;
}
return content;
}
};

View file

@ -1,24 +1,31 @@
const esbuild = require('esbuild')
const esbuild = require('esbuild');
const generateContentHash = require('../lib/generateContentHash');
module.exports = class {
data() {
return {
permalink: `/static/js/${generateContentHash('src/static/js/**/*.js')}.js`,
eleventyExcludeFromCollections: true
}
permalink: `/static/js/${generateContentHash(
'src/static/js/**/*.js',
)}.js`,
eleventyExcludeFromCollections: true,
};
}
async render() {
await esbuild.build({
entryPoints: ['src/static/js/search.js'],
inject: ['./src/static/js/hamburger.js','./src/static/js/animate.js','./src/static/js/modal.js'],
inject: [
'./src/static/js/hamburger.js',
'./src/static/js/animate.js',
'./src/static/js/modal.js',
],
bundle: true,
minify: true,
outfile: `_site/static/js/${generateContentHash('src/static/js/**/*.js')}.js`,
outfile: `_site/static/js/${generateContentHash(
'src/static/js/**/*.js',
)}.js`,
sourcemap: false,
target: 'es5'
})
target: 'es5',
});
}
}
};

View file

@ -1,15 +1,16 @@
const util = require('util');
const sass = require('sass'); // `npm i -D sass`
const renderSass = util.promisify(sass.render);
const purgecss = require('@fullhuman/postcss-purgecss')
const purgecss = require('@fullhuman/postcss-purgecss');
const postcss = require('postcss');
const generateContentHash = require('../lib/generateContentHash');
module.exports = class {
async data() {
return {
permalink: `/static/css/${generateContentHash('src/static/**/*.{scss,css}')}.css`,
permalink: `/static/css/${generateContentHash(
'src/static/**/*.{scss,css}',
)}.css`,
eleventyExcludeFromCollections: true,
};
}
@ -19,20 +20,39 @@ module.exports = class {
file: 'src/static/css/site.scss',
});
return await postcss([
require('postcss-nested'),
purgecss({
content: ['./src/**/*.njk', './src/**/*.md'],
safelist: {
deep: [/headShake/, /zoomIn/, /fadeInUp/, /pre/,/code/,/block/, /box/, /title/, /is-\d/, /table/, /message/, /message-header/, /message-body/, /panel-block/, /p-3/, /is-block/, /is-justify-content-space-between/, /is-light/, /is-active/, /is-info/],
}
}),
require('autoprefixer'),
require('cssnano'),
return await postcss([
require('postcss-nested'),
purgecss({
content: ['./src/**/*.njk', './src/**/*.md'],
safelist: {
deep: [
/headShake/,
/zoomIn/,
/fadeInUp/,
/pre/,
/code/,
/block/,
/box/,
/title/,
/is-\d/,
/table/,
/message/,
/message-header/,
/message-body/,
/panel-block/,
/p-3/,
/is-block/,
/is-justify-content-space-between/,
/is-light/,
/is-active/,
/is-info/,
],
},
}),
require('autoprefixer'),
require('cssnano'),
])
.process(result.css, { from: undefined })
.then(result => result.css);
.process(result.css, { from: undefined })
.then((result) => result.css);
}
};
};

View file

@ -13,52 +13,66 @@ Sometimes conditions are used to add classes to a tag. djLint removes whitespace
This pattern is recommended:
{% raw %}
```html
<div class="class1 {% if condition -%}class2{%- endif %}">content</div>
^ space here
^ space here
```
{% endraw %}
This pattern is not recommended:
{% raw %}
```html
<div class="class1{% if condition -%} class2{%- endif %}">content</div>
^ space here
^ space here
```
{% endraw %}
## ``format_attribute_template_tags`` and Spaceless Conditional Attributes
## `format_attribute_template_tags` and Spaceless Conditional Attributes
If ``format_attribute_template_tags`` option is enabled, conditional attributes should use spaceless tags, for example {% raw %}`{% if a -%}`{% endraw %} in nunjuck and jinja, to remove spaces inside the.
If `format_attribute_template_tags` option is enabled, conditional attributes should use spaceless tags, for example {% raw %}`{% if a -%}`{% endraw %} in nunjuck and jinja, to remove spaces inside the.
djLint will format long attributes onto multiple lines, and the whitespace saved inside of attributes could break your code.
This pattern is recommended:
{% raw %}
```html
<input value="{% if database -%}{{ database.name }}{%- else -%}blah{%- endif %}"/>
^ ^ ^ ^-- spaceless tags
<input
value="{% if database -%}{{ database.name }}{%- else -%}blah{%- endif %}"
/>
^ ^ ^ ^-- spaceless tags
```
{% endraw %}
This pattern is not recommended:
{% raw %}
```html
<input value="{% if database %}{{ database.name }}{% else %}blah{% endif %}"/>
<input value="{% if database %}{{ database.name }}{% else %}blah{% endif %}" />
```
{% endraw %}
After formatting this could look like:
{% raw %}
```html
<input value="{% if database %}
<input
value="{% if database %}
{{ database.name }}
{% else %}
blah
{% endif %}"/>
{% endif %}"
/>
```
{% endraw %}
{% endraw %}

View file

@ -9,144 +9,166 @@ keywords: template linter, template formatter, djLint, HTML, templates, formatte
# Changelog
## 0.7.2
::: content
- Bug fixes [#167](https://github.com/Riverside-Healthcare/djLint/issues/167), [#166](https://github.com/Riverside-Healthcare/djLint/issues/166), [#171](https://github.com/Riverside-Healthcare/djLint/issues/171), [#169](https://github.com/Riverside-Healthcare/djLint/issues/169)
:::
:::
## 0.7.1
::: content
- Bug fixes [#166](https://github.com/Riverside-Healthcare/djLint/issues/166)
:::
:::
## 0.7.0
::: content
- Added config for custom HTML tags
- Bug fixes
:::
:::
## 0.6.9
::: content
- Added HTML and Angular profiles
- Allowed some entities in rule #H023
- Bug fixes
:::
:::
## 0.6.8
::: content
- Bug fixes
- Updated docs
:::
:::
## 0.6.7
::: content
- Added config option ``format_attribute_template_tags`` as opt-in for template tag formatting inside of attributes
- Added config option ``linter_output_format`` to customize linter message variable order
- Added config option `format_attribute_template_tags` as opt-in for template tag formatting inside of attributes
- Added config option `linter_output_format` to customize linter message variable order
- Added rules H030 and H031 to check meta tags
:::
:::
## 0.6.6
::: content
- Big fixes
:::
:::
## 0.6.5
::: content
- Updated output paths to be relative to the project root
- Bug fixes
:::
:::
## 0.6.4
::: content
- Bug fixes
:::
:::
## 0.6.3
::: content
- Added support for django `blocktrans` tag
- Bug fixes
:::
:::
## 0.6.2
::: content
- Bug fixes
:::
:::
## 0.6.1
::: content
- Bug fixes
- Made rule T028 stricter with clearer message
:::
:::
## 0.6.0
::: content
- Added rule T027 to check for unclosed in template syntax
- Added rule T028 to check for missing spaceless tags in attributes
- Added rule H029 to check for lowercase form method
- Ignored djagno blocktranslate tags that do not have "trimmed" from formatter
- Bug fixes
:::
:::
## 0.5.9a
::: content
- Added test support for python 3.10
- Added pre-commit hook
:::
:::
## 0.5.9
::: content
- Added option ``--use-gitignore`` to extend the excludes
- Added option `--use-gitignore` to extend the excludes
- Changed default exclude matching
- Fixed windows exclude paths
- Fixed formatting of `{%...%}` tags in attributes
- Fixed formatting for for loops and nested conditions in attributes
:::
:::
## 0.5.8
::: content
- Added require_pragma option
- Updated DJ018 to catch ``data-src`` and ``action`` on inputs
- Updated DJ018 to catch `data-src` and `action` on inputs
- Fixed inline ignore syntax
- Added ``--lint`` option as placeholder for default usage
- Added `--lint` option as placeholder for default usage
- Bug fixes
:::
:::
## 0.5.7
::: content
- Bug fixes
:::
:::
## 0.5.6
::: content
- Added rule H026 to find empty id and class tags
- Bug fixes
:::
:::
## 0.5.5
::: content
- Consolidated settings and slimmed code
- Bug fixes
:::
:::
## 0.5.4
::: content
- Added rule H020 to find empty tag pairs
- Added rule H021 to find inline styles
- Added rule H022 to find http links
@ -154,191 +176,217 @@ keywords: template linter, template formatter, djLint, HTML, templates, formatte
- Added rule H024 to find type on scripts and styles
- Added rule H025 to check for orphan tags. Thanks to https://stackoverflow.com/a/1736801/10265880
- Improved attribute formatting
- Updated ``blank_line_after_tag`` option to add newline regardless of location
- Fixed django ``trans`` tag formatting
- Updated `blank_line_after_tag` option to add newline regardless of location
- Fixed django `trans` tag formatting
- Added formatting for inline styles
- Added formatting for template conditions inside attributes
- Added srcset as possible url location in linter rules
- Speed up formatting
- Special thanks to `jayvdb <https://github.com/jayvdb>`_
:::
- Special thanks to `jayvdb <https://github.com/jayvdb>`\_
:::
## 0.5.3
::: content
- Change stdout for ``--reformat/check`` options to only print new html when using stdin as the input
:::
- Change stdout for `--reformat/check` options to only print new html when using stdin as the input
:::
## 0.5.2
::: content
- Split ``alt`` requirement from H006 to H013
- Split `alt` requirement from H006 to H013
- Added optional custom rules file
- Added ``golang`` as profile option
- Added `golang` as profile option
- Fixed formatting of ignored blocks containing inline comments
- Added default text to ``--indent`` and ``-e`` options
- Added default text to `--indent` and `-e` options
- Update url rules to accept #
- Fixed file encoding on Windows OS
- Fix single line template tag regex
- Fix ``blank_line_after_tag`` for tags with leading space
:::
- Fix `blank_line_after_tag` for tags with leading space
:::
## 0.5.1
::: content
- Added rule H019
- Fixed bugs in DJ018 and H012
:::
:::
## 0.5.0
::: content
- Fixed several regex matching bugs in linter rules
- Stopped linter from returning errors in ignored blocks
- Added option to ignore code block from linter/formatter with `{% djlint:off %}...{% djlint:on %}` tags
:::
:::
## 0.4.9
::: content
- Fixed bug `#35 <https://github.com/Riverside-Healthcare/djLint/issues/35>`_
:::
- Fixed bug `#35 <https://github.com/Riverside-Healthcare/djLint/issues/35>`\_
:::
## 0.4.8
::: content
- Fixed bug `#34 <https://github.com/Riverside-Healthcare/djLint/issues/34>`_
:::
- Fixed bug `#34 <https://github.com/Riverside-Healthcare/djLint/issues/34>`\_
:::
## 0.4.7
::: content
- Moved ``source`` tag to single line tags
:::
- Moved `source` tag to single line tags
:::
## 0.4.6
::: content
- Fixed bug `#31 <https://github.com/Riverside-Healthcare/djLint/issues/31>`_
:::
- Fixed bug `#31 <https://github.com/Riverside-Healthcare/djLint/issues/31>`\_
:::
## 0.4.5
::: content
- Added best practices to docs
- Add ``--profile`` option to set default linter/formatter rules
- Add `--profile` option to set default linter/formatter rules
- Added linter rules for jinja url patterns
:::
:::
## 0.4.4
::: content
- Change indent config from string to int. ``--indent 3``
:::
- Change indent config from string to int. `--indent 3`
:::
## 0.4.3
::: content
- Added cli option for indent spacing. ``--indent=" "``
:::
- Added cli option for indent spacing. `--indent=" "`
:::
## 0.4.2
::: content
- Added support for additional whitespace after tags with ``blank_line_after_tag`` option
:::
- Added support for additional whitespace after tags with `blank_line_after_tag` option
:::
## 0.4.1
::: content
- Added support for processing several files or folders at once
:::
:::
## 0.4.0
::: content
- Fixed formatting of django `{# ... #}` tags
- Added indent support for figcaption, details and summary tags
- Added support for overriding or extending the list of excluded paths in ``pyproject.toml``
:::
- Added support for overriding or extending the list of excluded paths in `pyproject.toml`
:::
## 0.3.9
::: content
- Updated attribute handling
:::
:::
## 0.3.8
::: content
- Added support for stdin
:::
:::
## 0.3.7
::: content
- Fixed formatting on ``small``, ``dt``, and ``dd`` tags
:::
- Fixed formatting on `small`, `dt`, and `dd` tags
:::
## 0.3.6
::: content
- Added formatter support for Nunjucks `{%-` opening blocks
:::
:::
## 0.3.5
::: content
- Added support for more Django blocks
- Added support for custom blocks
- Added support for config in ``pyproject.toml``
:::
- Added support for config in `pyproject.toml`
:::
## 0.3.4
::: content
- Fixed Nunjucks spaceless tag ``-%}`` format
:::
- Fixed Nunjucks spaceless tag `-%}` format
:::
## 0.3.3
::: content
- Allowed short ``div`` tags to be single line
:::
- Allowed short `div` tags to be single line
:::
## 0.3.2
::: content
- Fixed Django comment formatting
- Ignored textarea from formatting
:::
:::
## 0.3.1
::: content
- Updated attribute formatting regex
- Updated lint rule W010
:::
:::
## 0.3.0
::: content
- Changed exit code to 1 if there were any formatting changes
- Added support for Jinja ``asset`` tags
:::
- Added support for Jinja `asset` tags
:::
## 0.2.9
::: content
- Updated W018 regex
- Removed duplicate lint messages
- Updated E001 for Handlebars
:::
:::
## 0.2.8
::: content
- Fixed progress bar error for old Click version
:::
{% endraw %}
- Fixed progress bar error for old Click version
:::
{% endraw %}

View file

@ -45,7 +45,7 @@ custom_blocks="toc,example"
## custom_html
Use to indent custom HTML tags. For example ``<mjml>`` or ``<simple-greeting>`` or ``<mj-\w+>``
Use to indent custom HTML tags. For example `<mjml>` or `<simple-greeting>` or `<mj-\w+>`
Usage:
@ -95,11 +95,12 @@ blank_line_after_tag="load,extends,include"
## profile
Set a default profile for the template language. The profile will disable linter rules that do not apply to your template language, and may also change reformatting. For example, in ``handlebars`` there are no spaces inside {% raw %}``{{#if}}``{% endraw %} tags.
Set a default profile for the template language. The profile will disable linter rules that do not apply to your template language, and may also change reformatting. For example, in `handlebars` there are no spaces inside {% raw %}`{{#if}}`{% endraw %} tags.
Options:
:::content
- html
- django
- jinja
@ -107,7 +108,7 @@ Options:
- handlebars (for handlebars and mustache)
- golang
- angular
:::
:::
Usage:
@ -124,18 +125,15 @@ Usage:
```ini
require_pragma=true
```
{% raw %}
```html
<!-- djlint:on -->
or
{# djlint:on #}
or
{% comment %} djlint:on {% endcomment %}
or
{{ /* djlint:on */ }}
or
{{!-- djlint:on --}}
or {# djlint:on #} or {% comment %} djlint:on {% endcomment %} or {{ /*
djlint:on */ }} or {{!-- djlint:on --}}
```
{% endraw %}
## max_line_length
@ -181,16 +179,18 @@ format_attribute_template_tags=true
For example, with this option enabled, the following html will be acceptable:
```html
<input class="{% if this %}
<input
class="{% if this %}
then something neat
{% else %}
that is long stuff asdf and more even
{% endif %}"/>
{% endif %}"
/>
```
## linter_output_format
Customize order of output message. Default="{code} {line} {message} {match}". If ``{filename}`` is not include in message, then the output will be grouped by file and a header will automatically be added to each group.
Customize order of output message. Default="{code} {line} {message} {match}". If `{filename}` is not include in message, then the output will be grouped by file and a header will automatically be added to each group.
Usage:
@ -204,4 +204,3 @@ Usage:
linter_output_format="{filename}:{line}: {code} {message} {match}"
```

View file

@ -1,3 +1,3 @@
{
"layout": "docs_layout.njk"
}
"layout": "docs_layout.njk"
}

View file

@ -8,7 +8,7 @@ keywords: template linter, template formatter, djLint, HTML, templates, formatte
djLint's formatter will take sloppy html templates and make the formatting consistent and easy to follow!
Formatting is a beta tool. ``--check`` the output before applying changes.
Formatting is a beta tool. `--check` the output before applying changes.
To review what may change in formatting run:
@ -38,7 +38,6 @@ djlint . --reformat
"djLint is not an html parser or syntax validator."
%}
## Ignoring Code
Code can be ignored by wrapping it in `djlint` tags:
@ -46,56 +45,50 @@ Code can be ignored by wrapping it in `djlint` tags:
{% raw %}
For plain old html -
```html
<!-- djlint:off -->
<bad html to ignore>
<!-- djlint:on -->
<bad html to ignore> <!-- djlint:on --></bad>
```
or as a comment -
```html
{# djlint:off #}
<bad html to ignore>
{# djlint:on #}
{# djlint:off #} <bad html to ignore> {# djlint:on #}</bad>
```
or as a long comment
```html
{% comment %} djlint:off {% endcomment %}
<bad html to ignore>
{% comment %} djlint:on {% endcomment %}
<bad html to ignore> {% comment %} djlint:on {% endcomment %}</bad>
```
or as a javascript style comment -
```html
{{ /* djlint:off */ }}
<bad html to ignore>
{{ /* djlint:on */ }}
{{ /* djlint:off */ }} <bad html to ignore> {{ /* djlint:on */ }}</bad>
```
or as a golan style comment -
```html
{{!-- djlint:off --}}
<bad html to ignore>
{{!-- djlint:on --}}
{{!-- djlint:off --}} <bad html to ignore> {{!-- djlint:on --}}</bad>
```
{% endraw %}
## Here's an example!
### Before
Here's a blob of HTML that's in desperate need of attention -
{% raw %}
```
{% load admin_list %}{% load i18n %}<p class="paginator">{% if pagination_required %}{% for i in page_range %}{% paginator_number cl i %}{% endfor %}{% endif %}{{ cl.result_count }}{% if cl.result_count == 1 %}{{ cl.opts.verbose_name }} {% else %}{{ cl.opts.verbose_name_plural }} {% endif %}{% if show_all_url %} <a href="{{ show_all_url }}" class="showall">{% translate 'Show all' %} </a> {% endif %}{% if cl.formset and cl.result_count %}<input type="submit" name="_save" class="default" value="{% translate 'Save' %}">{% endif %} </p>
```
{% endraw %}
### After
@ -103,29 +96,24 @@ Here's a blob of HTML that's in desperate need of attention -
It looks a bit better now... we can read it :)
{% raw %}
```html
{% load admin_list %}
{% load i18n %}
{% load admin_list %} {% load i18n %}
<p class="paginator">
{% if pagination_required %}
{% for i in page_range %}
{% paginator_number cl i %}
{% endfor %}
{% endif %}
{{ cl.result_count }}
{% if cl.result_count == 1 %}
{{ cl.opts.verbose_name }}
{% else %}
{{ cl.opts.verbose_name_plural }}
{% endif %}
{% if show_all_url %}
<a href="{{ show_all_url }}" class="showall">
{% translate 'Show all' %}
</a>
{% endif %}
{% if cl.formset and cl.result_count %}
<input type="submit" name="_save" class="default" value="{% translate 'Save' %}">
{% endif %}
{% if pagination_required %} {% for i in page_range %} {% paginator_number cl
i %} {% endfor %} {% endif %} {{ cl.result_count }} {% if cl.result_count == 1
%} {{ cl.opts.verbose_name }} {% else %} {{ cl.opts.verbose_name_plural }} {%
endif %} {% if show_all_url %}
<a href="{{ show_all_url }}" class="showall"> {% translate 'Show all' %} </a>
{% endif %} {% if cl.formset and cl.result_count %}
<input
type="submit"
name="_save"
class="default"
value="{% translate 'Save' %}"
/>
{% endif %}
</p>
```
{% endraw %}
{% endraw %}

View file

@ -46,7 +46,6 @@ Options:
"If the command `djlint` is not found, ensure sure that Python is [in your path](https://www.geeksforgeeks.org/how-to-add-python-to-windows-path/)."
%}
## Using Path vs Stdin
djLint works with a path or stdin.
@ -68,6 +67,7 @@ Or with stdin -
```bash
echo "<div></div>" | djlint -
```
Stdin can also be used to reformat code. The output will be only the formatted code without messages.
```bash

View file

@ -12,22 +12,23 @@ There are several editor integrations build for djLint.
djLint can be used as a [pre-commit](https://pre-commit.com) hook.
The repo provides multiple pre-configured hooks for specific djLint profiles (it just pre-sets the ``--profile`` argument and tells pre-commit which file extensions to look for):
The repo provides multiple pre-configured hooks for specific djLint profiles (it just pre-sets the `--profile` argument and tells pre-commit which file extensions to look for):
::: content
* ``djlint-django`` for Django templates:
This will look for files matching ``templates/**.html`` and set ``--profile=django``.
* ``djlint-jinja``
This will look for files matching ``*.j2`` and set ``--profile=jinja``.
* ``djlint-nunjucks``
This will look for files matching ``*.njk`` and set ``--profile=nunjucks``.
* ``djlint-handlebars``
This will look for files matching ``*.hbs`` and set ``--profile=handlebars``.
* ``djlint-golang``
This will look for files matching ``*.tmpl`` and set ``--profile=golang``.
:::
Note that these predefined hooks are sometimes too conservative in the inputs they accept (your templates may be using a different extension) so pre-commit explicitly allows you to override any of these pre-defined options. See the `pre-commit docs <https://pre-commit.com/#pre-commit-configyaml---hooks>`_ for additional configuration
- `djlint-django` for Django templates:
This will look for files matching `templates/**.html` and set `--profile=django`.
- `djlint-jinja`
This will look for files matching `*.j2` and set `--profile=jinja`.
- `djlint-nunjucks`
This will look for files matching `*.njk` and set `--profile=nunjucks`.
- `djlint-handlebars`
This will look for files matching `*.hbs` and set `--profile=handlebars`.
- `djlint-golang`
This will look for files matching `*.tmpl` and set `--profile=golang`.
:::
Note that these predefined hooks are sometimes too conservative in the inputs they accept (your templates may be using a different extension) so pre-commit explicitly allows you to override any of these pre-defined options. See the `pre-commit docs <https://pre-commit.com/#pre-commit-configyaml---hooks>`\_ for additional configuration
### Default Django example
@ -50,19 +51,20 @@ repos:
files: "\\.html"
```
You can use the ``files`` or ``exclude`` parameters to constrain each hook to its own directory, allowing you to support multiple template languages within the same repo.
You can use the `files` or `exclude` parameters to constrain each hook to its own directory, allowing you to support multiple template languages within the same repo.
## SublimeText Linter
djLint can be used as a SublimeText Linter plugin. It can be installed via [package-control](https://packagecontrol.io/packages/SublimeLinter-contrib-djlint).
::: content
1. ``cmd + shft + p``
1. `cmd + shft + p`
2. Install SublimeLinter
3. Install SublimeLinter-contrib-djlint
:::
:::
Ensure djLint is installed in your global python, or on yout ``PATH``.
Ensure djLint is installed in your global python, or on yout `PATH`.
## coc.nvim

View file

@ -5,7 +5,6 @@ description: djLint is a angular template linter! Take advantage of the pre-buil
tool: angular
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -5,7 +5,6 @@ description: djLint is a django template linter and a django template formatter!
tool: django
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -5,7 +5,6 @@ description: djLint is a GoLang template linter and a GoLang template formatter!
tool: golang
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -5,7 +5,6 @@ description: djLint is a handlebars template linter and a handlebars template fo
tool: handlebars
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -5,7 +5,6 @@ description: djLint is a jinja template linter and a jinja template formatter! T
tool: jinja
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -1,3 +1,3 @@
{
"layout": "languages_layout.njk"
}
"layout": "languages_layout.njk"
}

View file

@ -5,7 +5,6 @@ description: djLint is a mustache template linter and a mustache template format
tool: handlebars
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -5,7 +5,6 @@ description: djLint is a nunjucks template linter and a nunjucks template format
tool: nunjucks
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -5,7 +5,6 @@ description: djLint is a twig template linter and a twig template formatter! Tak
tool: nunjucks
---
# {{ title }}
{{ description }}
@ -18,7 +17,7 @@ djlint /path/to/templates --profile={{ tool }}
#### Or, Use a Config File
Configure djLint in your projects ``pyproject.toml``.
Configure djLint in your projects `pyproject.toml`.
```toml
[tool.djlint]
@ -27,4 +26,4 @@ profile="{{ tool }}"
<div class="box notification is-info is-light">
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
</div>

View file

@ -22,10 +22,9 @@ djlint /path/to/this.html.j2 --profile=jinja
<span class="icon is-large"><i class="fas fa-2x fa-arrow-circle-right"></i></span><div class="my-auto ml-3 is-inline-block"><a href="/docs/configuration/">Check out the configuration guide for all the options!</a></div>
</div>
## Custom Rules
Create a file ``.djlint_rules.yaml`` alongside your ``pyproject.toml``. Rules can be added to this files and djLint will pick them up.
Create a file `.djlint_rules.yaml` alongside your `pyproject.toml`. Rules can be added to this files and djLint will pick them up.
A good rule follows this pattern:
@ -35,48 +34,46 @@ A good rule follows this pattern:
message: Find Trichotillomania
flags: re.DOTALL|re.I
patterns:
- Trichotillomania
- Trichotillomania
```
## Rules
| Code | Meaning |
|--------|---------------------------------------------------------------------------|
| T001 | Variables should be wrapped in a single whitespace. Ex: {% raw %}``{{ this }}``{% endraw %} |
| T002 | Double quotes should be used in tags. Ex {% raw %}``{% extends "this.html" %}``{% endraw %} |
| T003 | Endblock should have name. Ex: {% raw %}``{% endblock body %}``{% endraw %}. |
| D004 | (Django) Static urls should follow {% raw %}``{% static path/to/file %}``{% endraw %} pattern. |
| J004 | (Jinja) Static urls should follow {% raw %}``{{ url_for('static'..) }}``{% endraw %} pattern. |
| H005 | Html tag should have ``lang`` attribute. |
| H006 | ``img`` tag should have ``height`` and ``width`` attributes. |
| H007 | ``<!DOCTYPE ... >`` should be present before the html tag. |
| H008 | Attributes should be double quoted. |
| H009 | Tag names should be lowercase. |
| H010 | Attribute names should be lowercase. |
| H011 | Attribute values should be quoted. |
| H012 | There should be no spaces around attribute ``=``. |
| H013 | ``img`` tag should have alt attributes. |
| H014 | More than 2 blank lines. |
| H015 | Follow ``h`` tags with a line break. |
| H016 | Missing ``title`` tag in html. |
| H017 | Tag should be self closing. |
| D018 | (Django) Internal links should use the {% raw %}``{% url ... %}``{% endraw %} pattern. |
| J018 | (Jinja) Internal links should use the {% raw %}``{% url ... %}``{% endraw %} pattern. |
| H019 | Replace ``javascript:abc()`` with ``on_`` event and real url. |
| H020 | Empty tag pair found. Consider removing. |
| H021 | Inline styles should be avoided. |
| H022 | Use HTTPS for external links. |
| H023 | Do not use entity references. |
| H024 | Omit type on scripts and styles. |
| H025 | Tag seems to be an orphan. |
| H026 | Emtpy id and class tags can be removed. |
| T027 | Unclosed string found in template syntax. |
| T028 | Consider using spaceless tags inside attribute values. {% raw %}``{%- if/for -%}``{% endraw %} |
| H029 | Consider using lowercase form method values. |
| H030 | Consider adding a meta description. |
| H031 | Consider adding meta keywords. |
| Code | Meaning |
| ---- | -------------------------------------------------------------------------------------------- |
| T001 | Variables should be wrapped in a single whitespace. Ex: {% raw %}`{{ this }}`{% endraw %} |
| T002 | Double quotes should be used in tags. Ex {% raw %}`{% extends "this.html" %}`{% endraw %} |
| T003 | Endblock should have name. Ex: {% raw %}`{% endblock body %}`{% endraw %}. |
| D004 | (Django) Static urls should follow {% raw %}`{% static path/to/file %}`{% endraw %} pattern. |
| J004 | (Jinja) Static urls should follow {% raw %}`{{ url_for('static'..) }}`{% endraw %} pattern. |
| H005 | Html tag should have `lang` attribute. |
| H006 | `img` tag should have `height` and `width` attributes. |
| H007 | `<!DOCTYPE ... >` should be present before the html tag. |
| H008 | Attributes should be double quoted. |
| H009 | Tag names should be lowercase. |
| H010 | Attribute names should be lowercase. |
| H011 | Attribute values should be quoted. |
| H012 | There should be no spaces around attribute `=`. |
| H013 | `img` tag should have alt attributes. |
| H014 | More than 2 blank lines. |
| H015 | Follow `h` tags with a line break. |
| H016 | Missing `title` tag in html. |
| H017 | Tag should be self closing. |
| D018 | (Django) Internal links should use the {% raw %}`{% url ... %}`{% endraw %} pattern. |
| J018 | (Jinja) Internal links should use the {% raw %}`{% url ... %}`{% endraw %} pattern. |
| H019 | Replace `javascript:abc()` with `on_` event and real url. |
| H020 | Empty tag pair found. Consider removing. |
| H021 | Inline styles should be avoided. |
| H022 | Use HTTPS for external links. |
| H023 | Do not use entity references. |
| H024 | Omit type on scripts and styles. |
| H025 | Tag seems to be an orphan. |
| H026 | Emtpy id and class tags can be removed. |
| T027 | Unclosed string found in template syntax. |
| T028 | Consider using spaceless tags inside attribute values. {% raw %}`{%- if/for -%}`{% endraw %} |
| H029 | Consider using lowercase form method values. |
| H030 | Consider adding a meta description. |
| H031 | Consider adding meta keywords. |
### Adding Rules
@ -85,13 +82,14 @@ We welcome pull requests with new rules!
A good rule consists of
::: content
- Name
- Code
- Message - Message to display when error is found.
- Flags - Regex flags. Defaults to re.DOTALL. ex: re.I|re.M
- Patterns - regex expressions that will find the error.
- Exclude - Optional list of profiles to exclude rule from.
:::
- Name
- Code
- Message - Message to display when error is found.
- Flags - Regex flags. Defaults to re.DOTALL. ex: re.I|re.M
- Patterns - regex expressions that will find the error.
- Exclude - Optional list of profiles to exclude rule from.
:::
Please include a test to validate the rule.
@ -100,10 +98,11 @@ Please include a test to validate the rule.
The first letter of a code follows the pattern:
::: content
- T: applies generally to templates
- H: applies to html
- D: applies specifically to Django
- J: applies specifically to Jinja
- N: applies specifically to Nunjucks
- M: applies specifically to Handlebars
:::
:::

View file

@ -1,11 +1,14 @@
const algoliasearch = require("algoliasearch");
const algoliasearch = require('algoliasearch');
const objects = require("../../_site/search/all.json");
const objects = require('../../_site/search/all.json');
const client = algoliasearch('QFXNLHI6NP', process.env.ALGOLIA_SEARCH);
const index = client.initIndex('dev_atlas');
index.replaceAllObjects(objects, { autoGenerateObjectIDIfNotExist: true }).then(() => {
console.log("updated");
}).catch((error) => console.error("Failed to Algolia update index", error));
index
.replaceAllObjects(objects, { autoGenerateObjectIDIfNotExist: true })
.then(() => {
console.log('updated');
})
.catch((error) => console.error('Failed to Algolia update index', error));

View file

@ -1,20 +1,18 @@
$link-hover: hsl(207, 61%, 53%);
$link: hsl(207, 61%, 53%);
$link-hover:hsl(207, 61%, 53%);
$link: hsl(207, 61%, 53%);
@import '../../../node_modules/bulma/bulma';
@import '../../../node_modules/bulma-pricingtable/src/sass/index';
@import '../../../node_modules/@creativebulma/bulma-divider/src/sass/index';
$fontDir: '/static/font/inter/';
@import '../../../node_modules/@fontsource/inter/scss/mixins';
@import "../../../node_modules/bulma/bulma";
@import "../../../node_modules/bulma-pricingtable/src/sass/index";
@import "../../../node_modules/@creativebulma/bulma-divider/src/sass/index";
$use-all: true;
$use-slideInDown: true;
@import '../../../node_modules/animate-sass/animate';
$fontDir: "/static/font/inter/";
@import "../../../node_modules/@fontsource/inter/scss/mixins";
$use-all:true;
$use-slideInDown:true;
@import "../../../node_modules/animate-sass/animate";
@import "../font/fontawesome/stylesheet";
@import '../font/fontawesome/stylesheet';
/* purgecss start ignore */
@ -32,14 +30,14 @@ pre .tag {
padding-right: unset;
white-space: unset;
}
@import "../../../node_modules/prismjs/themes/prism";
@import '../../../node_modules/prismjs/themes/prism';
@include fontFace(
$fontName: Inter,
$weight: 400,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/inter/files/"
$fontDir: '/static/font/inter/files/'
);
@include fontFace(
@ -47,7 +45,7 @@ pre .tag {
$weight: 600,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/inter/files/"
$fontDir: '/static/font/inter/files/'
);
@include fontFace(
@ -55,18 +53,18 @@ pre .tag {
$weight: 700,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/inter/files/"
$fontDir: '/static/font/inter/files/'
);
$fontDir: "/static/font/rasa/";
@import "../../../node_modules/@fontsource/rasa/scss/mixins";
$fontDir: '/static/font/rasa/';
@import '../../../node_modules/@fontsource/rasa/scss/mixins';
@include fontFace(
$fontName: Rasa,
$weight: 300,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/rasa/files/"
$fontDir: '/static/font/rasa/files/'
);
@include fontFace(
@ -74,7 +72,7 @@ $fontDir: "/static/font/rasa/";
$weight: 500,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/rasa/files/"
$fontDir: '/static/font/rasa/files/'
);
@include fontFace(
@ -82,7 +80,7 @@ $fontDir: "/static/font/rasa/";
$weight: 600,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/rasa/files/"
$fontDir: '/static/font/rasa/files/'
);
@include fontFace(
@ -90,66 +88,66 @@ $fontDir: "/static/font/rasa/";
$weight: 700,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/rasa/files/"
$fontDir: '/static/font/rasa/files/'
);
$fontDir: "/static/font/crimson-pro/";
@import "../../../node_modules/@fontsource/crimson-pro/scss/mixins";
$fontDir: '/static/font/crimson-pro/';
@import '../../../node_modules/@fontsource/crimson-pro/scss/mixins';
@include fontFace(
$fontName: 'Crimson Pro',
$weight: 400,
$display: swap,
$unicodeMap: latin,
$fontDir: "/static/font/crimson-pro/files/"
$fontDir: '/static/font/crimson-pro/files/'
);
html {
height: 100%;
}
body {
font-family: "Inter", Arial, Verdana, Tahoma, sans-serif;
font-family: 'Inter', Arial, Verdana, Tahoma, sans-serif;
display: flex;
flex-direction: column;
min-height: 100%;
}
.title {
font-family: "Rasa", Georgia, "Times New Roman", Times, serif;
font-family: 'Rasa', Georgia, 'Times New Roman', Times, serif;
}
.huge {
font-size:100px;
font-size: 100px;
}
.djlint-nav {
padding-left: 15px;
}
.djlint-nav .navbar-brand a {
margin-top:auto;
margin-bottom:auto;
margin-top: auto;
margin-bottom: auto;
}
body.has-navbar-fixed-top, html.has-navbar-fixed-top {
padding-top:118px;
body.has-navbar-fixed-top,
html.has-navbar-fixed-top {
padding-top: 118px;
}
.djlint-nav .navbar-brand img {
width:auto;
width: auto;
height: 40px !important;
margin-top: 6px;
margin-bottom: -2px;
}
.is-flex-widescreen {
display:none !important;
display: none !important;
}
@media screen and (min-width: $widescreen) {
.djlint-nav {
padding: 15px 0;
}
.djlint-nav .navbar-brand img {
.djlint-nav .navbar-brand img {
height: 56px !important;
}
@ -159,14 +157,14 @@ body.has-navbar-fixed-top, html.has-navbar-fixed-top {
}
.image.brand {
height:200px;
height: 200px;
display: flex;
justify-content: center;
align-items: center;
}
.image.brand img {
max-width: 200px;
max-height:200px;
max-height: 200px;
}
a.navbar-item:hover,
@ -192,7 +190,7 @@ h2 {
}
.is-nav-icon .fa-2x {
font-size:1.6em;
font-size: 1.6em;
}
/* fix for prism in bulma */
@ -214,15 +212,15 @@ pre .number {
}
.mail-icon > img {
margin-top:3px;
margin-top: 3px;
}
/* comparison */
.plan-item .icon {
height:auto;
height: auto;
}
.plan-item .icon svg {
height:15px;
width:15px
height: 15px;
width: 15px;
}
.pricing-table .pricing-plan .plan-group {
@ -231,7 +229,7 @@ pre .number {
color: #4a4a4a;
font-size: $size-6;
font-weight: 600;
padding: .75em;
padding: 0.75em;
text-align: center;
}
@ -239,7 +237,6 @@ pre .number {
font-size: $size-6;
}
.icon.is-huge {
height: 2.5em;
width: 2.5em;
@ -247,24 +244,23 @@ pre .number {
/* search */
#search-form .icon svg {
height:1.2rem;
height: 1.2rem;
}
#search-results {
position:absolute;
top:70px;
left:0;
right:0;
display:none;
border-radius: $radius
position: absolute;
top: 70px;
left: 0;
right: 0;
display: none;
border-radius: $radius;
}
#search-results:empty {
display: none !important;
}
#search:focus {
#search:focus {
border-color: $info;
box-shadow: $input-focus-box-shadow-size bulmaRgba($info, 0.25);
}
@ -273,15 +269,14 @@ pre .number {
box-shadow: $input-focus-box-shadow-size bulmaRgba($info, 0.25);
}
#search-wrap:focus-within #search-results
{
display:block;
#search-wrap:focus-within #search-results {
display: block;
box-shadow: $input-focus-box-shadow-size bulmaRgba($info, 0.25);
border: 1px solid $info;
}
#search-results:active {
display:block;
display: block;
box-shadow: $input-focus-box-shadow-size bulmaRgba($info, 0.25);
border: 1px solid $info;
}
@ -297,7 +292,7 @@ pre .number {
}
.story {
font-family: Crimson Pro,Georgia,serif;
font-family: Crimson Pro, Georgia, serif;
font-size: 24px;
font-weight: 400;
line-height: 1.6666666667;
@ -309,62 +304,62 @@ pre .number {
// tabs
.tab-container {
@extend %block
@extend %block;
}
.tab-container .tab {
display:none
display: none;
}
.tab-container .tab.is-active {
display:initial;
display: initial;
}
// admonitions
.message-header .icon svg {
height:$size-6;
padding-right:10px;
height: $size-6;
padding-right: 10px;
}
.message.note {
border-width:$message-body-border-width;
border-style:solid;
border-width: $message-body-border-width;
border-style: solid;
border-color: $info;
background-color:$white;
padding:0;
background-color: $white;
padding: 0;
}
.message.hint {
border-width:$message-body-border-width;
border-style:solid;
border-width: $message-body-border-width;
border-style: solid;
border-color: $success;
background-color:$white;
padding:0;
background-color: $white;
padding: 0;
}
.message.alert {
border-width:$message-body-border-width;
border-style:solid;
border-width: $message-body-border-width;
border-style: solid;
border-color: $danger;
background-color:$white;
padding:0;
background-color: $white;
padding: 0;
}
.message.note .message-header {
color:$text;
background-color:$info-light;
color: $text;
background-color: $info-light;
}
.message.hint .message-header {
color:$text;
background-color:$success-light;
color: $text;
background-color: $success-light;
}
.message.alert .message-header {
color:$text;
background-color:$danger-light;
color: $text;
background-color: $danger-light;
}
.message.note .message-body,
.message.hint .message-body,
.message.alert .message-body {
color:$text;
color: $text;
}
.image.is-35x35 {
@ -373,60 +368,60 @@ pre .number {
}
/* menu collapse */
.is-collapsible, .is-collapsible.is-active {
.is-collapsible,
.is-collapsible.is-active {
transition: max-height 0.2s ease-out;
}
.is-collapsible {
max-height:0;
overflow:hidden;
margin-top:0;
margin-bottom:0;
max-height: 0;
overflow: hidden;
margin-top: 0;
margin-bottom: 0;
}
.is-collapsible-menu {
height:0;
height: 0;
overflow: hidden;
margin-top:0;
margin-bottom:0;
margin-top: 0;
margin-bottom: 0;
}
.is-collapsible-menu.is-active {
height:auto;
height: auto;
}
.is-collapsible-menu:not(.is-active) {
margin-top:0 !important;
margin-bottom:0 !important;
margin-top: 0 !important;
margin-bottom: 0 !important;
}
.is-collapsible-menu .is-collapsible-menu {
margin-bottom:0 !important;
margin-bottom: 0 !important;
}
.menu .menu-label {
font-weight:600;
font-weight: 600;
font-size: unset;
color: $grey-dark
color: $grey-dark;
}
.menu li a{
.menu li a {
position: relative;
padding-left:20px;
padding-left: 20px;
}
.menu li a.is-active{
background:unset;
.menu li a.is-active {
background: unset;
color: unset;
font-weight: 700;
}
.menu li.head > a {
font-weight: 600
font-weight: 600;
}
.menu-list li.head ul {
margin-left:3px;
padding-left:20px;
margin-left: 3px;
padding-left: 20px;
}
.menu-list a:hover,
@ -437,46 +432,44 @@ pre .number {
.menu li a:before {
position: absolute;
display: block;
margin-right:18px;
margin-left:-18px;
content: "";
margin-right: 18px;
margin-left: -18px;
content: '';
}
.menu li a:not([data-action="collapse-menu"]):before {
height:4px;
width:4px;
border-radius:4px;
.menu li a:not([data-action='collapse-menu']):before {
height: 4px;
width: 4px;
border-radius: 4px;
background: $grey;
top: calc(50% - 2px);
}
.menu li a[data-action="collapse-menu"]:before {
.menu li a[data-action='collapse-menu']:before {
border: 2px solid $grey-light;
border-radius: 2px;
border-right: 0;
border-top: 0;
height: 7px;
margin-top: -.4375em;
margin-top: -0.4375em;
transform-origin: 3px 4px;
width: 7px;
transition: transform .2s;
transition: transform 0.2s;
transform: rotate(-135deg);
top: calc(50% + 3px);
margin-left: -19px;
}
.menu li a.is-active[data-action="collapse-menu"]:before {
.menu li a.is-active[data-action='collapse-menu']:before {
transform: rotate(-45deg);
transition: transform .2s;
transition: transform 0.2s;
}
pre {
margin-bottom: 1.5rem !important;
}
.column:not(.is-narrow) {
min-width:0px;
min-width: 0px;
}
.is-inlineblock {
@ -484,7 +477,7 @@ pre {
}
.is-radius > img {
border-radius: $radius
border-radius: $radius;
}
.is-framed {
@ -492,30 +485,30 @@ pre {
border: 8px solid $grey-lightest;
border-radius: 4px;
border-top: 24px solid $grey-lightest;
box-shadow: 0 .5em 1em -.125em #0a0a0a1a,0 0 0 1px #0a0a0a05;
box-shadow: 0 0.5em 1em -0.125em #0a0a0a1a, 0 0 0 1px #0a0a0a05;
position: relative;
}
.is-framed::before {
border-radius: 10px;
content: "";
height: 15px;
left: 0px;
position: absolute;
top: -19px;
width: 15px;
background: $grey-light;
border-radius: 10px;
content: '';
height: 15px;
left: 0px;
position: absolute;
top: -19px;
width: 15px;
background: $grey-light;
}
.is-framed::after {
border-radius: 10px;
content: "";
height: 15px;
left: 20px;
position: absolute;
top: -19px;
width: 15px;
background: $grey-light;
border-radius: 10px;
content: '';
height: 15px;
left: 20px;
position: absolute;
top: -19px;
width: 15px;
background: $grey-light;
}
.hero.is-white .hero-body {
@ -523,11 +516,11 @@ background: $grey-light;
}
.hero {
position:relative
position: relative;
}
a.card:hover {
box-shadow: 0 .5em 2em -.125em #0a0a0a1a,0 0 0 1px #0a0a0a05;
box-shadow: 0 0.5em 2em -0.125em #0a0a0a1a, 0 0 0 1px #0a0a0a05;
}
.title {
@ -535,24 +528,24 @@ a.card:hover {
}
@media screen and (min-width: $tablet) {
.is-sticky {
position: sticky;
top:118px;
bottom:0;
max-height: calc(100vh - 118px);
overflow-y: scroll;
}
}
@media screen and (min-width: $desktop){
.navbar.is-transparent a.is-info.navbar-item:hover {
background-color: $info-dark !important;
position: sticky;
top: 118px;
bottom: 0;
max-height: calc(100vh - 118px);
overflow-y: scroll;
}
}
@media screen and (min-width: $desktop) {
.navbar.is-transparent a.is-info.navbar-item:hover {
background-color: $info-dark !important;
}
}
.navbar-item.button.is-white:hover {
background: transparent !important;
}
.is-256x256 {
max-height:256px;
max-width:256px;
max-height: 256px;
max-width: 256px;
}
@media screen and (max-width: $tablet) {
.main {
@ -560,16 +553,16 @@ a.card:hover {
}
}
.animated[data-animate] {
visibility:hidden
visibility: hidden;
}
.navbar-item .media img {
max-height:unset !important;
max-height: unset !important;
}
.icon.is-5x {
height:6rem;
width:6rem;
height: 6rem;
width: 6rem;
}
/* purgecss end ignore */
@ -579,6 +572,6 @@ a.card:hover {
.is-mega-menu-title {
margin-bottom: 0;
padding: .375rem 1rem;
padding: 0.375rem 1rem;
}
}

View file

@ -1,21 +1,21 @@
// Variables
// --------------------------
@use "sass:math";
$fa-font-path: "../webfonts" !default;
$fa-font-size-base: 16px !default;
$fa-font-display: block !default;
$fa-css-prefix: fa !default;
$fa-version: "5.15.4" !default;
$fa-border-color: #eee !default;
$fa-inverse: #fff !default;
$fa-li-width: 2em !default;
$fa-fw-width: math.div(20em, 16);
$fa-primary-opacity: 1 !default;
$fa-secondary-opacity: .4 !default;
@use 'sass:math';
$fa-font-path: '../webfonts' !default;
$fa-font-size-base: 16px !default;
$fa-font-display: block !default;
$fa-css-prefix: fa !default;
$fa-version: '5.15.4' !default;
$fa-border-color: #eee !default;
$fa-inverse: #fff !default;
$fa-li-width: 2em !default;
$fa-fw-width: math.div(20em, 16);
$fa-primary-opacity: 1 !default;
$fa-secondary-opacity: 0.4 !default;
// Convenience function used to set content property
@function fa-content($fa-var) {
@return unquote("\"#{ $fa-var }\"");
@return unquote('"#{ $fa-var }"');
}
$fa-var-500px: \f26e;

View file

@ -1,9 +1,8 @@
@use "sass:math";
@use 'sass:math';
@import "_variables";
@import '_variables';
$fa-font-path: "/static/font/fontawesome/webfonts";
$fa-font-path: '/static/font/fontawesome/webfonts';
/* from font awesome */
@font-face {
@ -12,14 +11,16 @@ $fa-font-path: "/static/font/fontawesome/webfonts";
font-weight: 400;
font-display: $fa-font-display;
src: url('#{$fa-font-path}/fa-regular-400.eot');
src: url('#{$fa-font-path}/fa-regular-400.eot?#iefix') format('embedded-opentype'),
url('#{$fa-font-path}/fa-regular-400.woff2') format('woff2'),
url('#{$fa-font-path}/fa-regular-400.woff') format('woff'),
url('#{$fa-font-path}/fa-regular-400.ttf') format('truetype'),
url('#{$fa-font-path}/fa-regular-400.svg#fontawesome') format('svg');
src: url('#{$fa-font-path}/fa-regular-400.eot?#iefix')
format('embedded-opentype'),
url('#{$fa-font-path}/fa-regular-400.woff2') format('woff2'),
url('#{$fa-font-path}/fa-regular-400.woff') format('woff'),
url('#{$fa-font-path}/fa-regular-400.ttf') format('truetype'),
url('#{$fa-font-path}/fa-regular-400.svg#fontawesome') format('svg');
}
.far, .fab {
.far,
.fab {
font-family: 'Font Awesome 5 Free';
font-weight: 400;
}
@ -30,11 +31,12 @@ $fa-font-path: "/static/font/fontawesome/webfonts";
font-weight: 900;
font-display: $fa-font-display;
src: url('#{$fa-font-path}/fa-solid-900.eot');
src: url('#{$fa-font-path}/fa-solid-900.eot?#iefix') format('embedded-opentype'),
url('#{$fa-font-path}/fa-solid-900.woff2') format('woff2'),
url('#{$fa-font-path}/fa-solid-900.woff') format('woff'),
url('#{$fa-font-path}/fa-solid-900.ttf') format('truetype'),
url('#{$fa-font-path}/fa-solid-900.svg#fontawesome') format('svg');
src: url('#{$fa-font-path}/fa-solid-900.eot?#iefix')
format('embedded-opentype'),
url('#{$fa-font-path}/fa-solid-900.woff2') format('woff2'),
url('#{$fa-font-path}/fa-solid-900.woff') format('woff'),
url('#{$fa-font-path}/fa-solid-900.ttf') format('truetype'),
url('#{$fa-font-path}/fa-solid-900.svg#fontawesome') format('svg');
}
@font-face {
@ -43,11 +45,12 @@ $fa-font-path: "/static/font/fontawesome/webfonts";
font-weight: 400;
font-display: $fa-font-display;
src: url('#{$fa-font-path}/fa-brands-400.eot');
src: url('#{$fa-font-path}/fa-brands-400.eot?#iefix') format('embedded-opentype'),
url('#{$fa-font-path}/fa-brands-400.woff2') format('woff2'),
url('#{$fa-font-path}/fa-brands-400.woff') format('woff'),
url('#{$fa-font-path}/fa-brands-400.ttf') format('truetype'),
url('#{$fa-font-path}/fa-brands-400.svg#fontawesome') format('svg');
src: url('#{$fa-font-path}/fa-brands-400.eot?#iefix')
format('embedded-opentype'),
url('#{$fa-font-path}/fa-brands-400.woff2') format('woff2'),
url('#{$fa-font-path}/fa-brands-400.woff') format('woff'),
url('#{$fa-font-path}/fa-brands-400.ttf') format('truetype'),
url('#{$fa-font-path}/fa-brands-400.svg#fontawesome') format('svg');
}
.fa,
@ -61,10 +64,12 @@ $fa-font-path: "/static/font/fontawesome/webfonts";
.#{$fa-css-prefix}-ul {
list-style-type: none;
margin-left: $fa-li-width * math.div(5,4);
margin-left: $fa-li-width * math.div(5, 4);
padding-left: 0;
> li { position: relative; }
> li {
position: relative;
}
}
.#{$fa-css-prefix}-li {
@ -82,15 +87,15 @@ $fa-font-path: "/static/font/fontawesome/webfonts";
.#{$fa-css-prefix}-lg {
font-size: math.div(4em, 3);
line-height: math.div(3em, 4);
vertical-align: -.0667em;
vertical-align: -0.0667em;
}
.#{$fa-css-prefix}-xs {
font-size: .75em;
font-size: 0.75em;
}
.#{$fa-css-prefix}-sm {
font-size: .875em;
font-size: 0.875em;
}
.#{$fa-css-prefix}-2_3x {
@ -121,40 +126,39 @@ $fa-font-path: "/static/font/fontawesome/webfonts";
line-height: 1;
}
/* build icon list */
$icons: (
infinity: $fa-var-infinity,
search: $fa-var-search,
book: $fa-var-book,
project-diagram: $fa-var-project-diagram,
heart: $fa-var-heart,
address-card: $fa-var-address-card,
server: $fa-var-server,
database: $fa-var-database,
ship: $fa-var-ship,
code: $fa-var-code,
sitemap: $fa-var-sitemap,
chart-bar: $fa-var-chart-bar,
tasks: $fa-var-tasks,
sliders-h: $fa-var-sliders-h,
lock: $fa-var-lock,
compass: $fa-var-compass,
user: $fa-var-user,
users: $fa-var-users,
share: $fa-var-share,
discord: $fa-var-discord,
github: $fa-var-github,
envelope: $fa-var-envelope,
download: $fa-var-download,
sync-alt: $fa-var-sync-alt,
life-ring: $fa-var-life-ring,
pencil-alt: $fa-var-pencil-alt,
arrow-circle-right: $fa-var-arrow-circle-right,
infinity: $fa-var-infinity,
search: $fa-var-search,
book: $fa-var-book,
project-diagram: $fa-var-project-diagram,
heart: $fa-var-heart,
address-card: $fa-var-address-card,
server: $fa-var-server,
database: $fa-var-database,
ship: $fa-var-ship,
code: $fa-var-code,
sitemap: $fa-var-sitemap,
chart-bar: $fa-var-chart-bar,
tasks: $fa-var-tasks,
sliders-h: $fa-var-sliders-h,
lock: $fa-var-lock,
compass: $fa-var-compass,
user: $fa-var-user,
users: $fa-var-users,
share: $fa-var-share,
discord: $fa-var-discord,
github: $fa-var-github,
envelope: $fa-var-envelope,
download: $fa-var-download,
sync-alt: $fa-var-sync-alt,
life-ring: $fa-var-life-ring,
pencil-alt: $fa-var-pencil-alt,
arrow-circle-right: $fa-var-arrow-circle-right,
);
@each $key, $value in $icons {
.#{$fa-css-prefix}-#{$key}:before {
content: fa-content($value);
}
.#{$fa-css-prefix}-#{$key}:before {
content: fa-content($value);
}
}

View file

@ -1,3 +1,122 @@
@charset "UTF-8";
/*! bulma.io v0.9.3 | MIT License | github.com/jgthms/bulma */.breadcrumb{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.breadcrumb:not(:last-child){margin-bottom:1.5rem}
/*! minireset.css v0.0.6 | MIT License | github.com/jgthms/minireset.css */*,:after,:before{box-sizing:inherit}@-webkit-keyframes spinAround{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}@keyframes spinAround{0%{transform:rotate(0deg)}to{transform:rotate(359deg)}}@-webkit-keyframes moveIndeterminate{0%{background-position:200% 0}to{background-position:-200% 0}}@keyframes moveIndeterminate{0%{background-position:200% 0}to{background-position:-200% 0}}.breadcrumb{font-size:1rem;white-space:nowrap}.breadcrumb a{align-items:center;color:#485fc7;display:flex;justify-content:center;padding:0 .75em}.breadcrumb a:hover{color:#363636}.breadcrumb li{align-items:center;display:flex}.breadcrumb li:first-child a{padding-left:0}.breadcrumb li.is-active a{color:#363636;cursor:default;pointer-events:none}.breadcrumb li+li:before{color:#b5b5b5;content:"/"}.breadcrumb ol,.breadcrumb ul{align-items:flex-start;display:flex;flex-wrap:wrap;justify-content:flex-start}.breadcrumb .icon:first-child{margin-right:.5em}.breadcrumb .icon:last-child{margin-left:.5em}.breadcrumb.is-centered ol,.breadcrumb.is-centered ul{justify-content:center}.breadcrumb.is-right ol,.breadcrumb.is-right ul{justify-content:flex-end}.breadcrumb.is-small{font-size:.75rem}.breadcrumb.is-medium{font-size:1.25rem}.breadcrumb.is-large{font-size:1.5rem}.breadcrumb.has-arrow-separator li+li:before{content:"→"}.breadcrumb.has-bullet-separator li+li:before{content:"•"}.breadcrumb.has-dot-separator li+li:before{content:"·"}.breadcrumb.has-succeeds-separator li+li:before{content:"≻"}
/*! bulma.io v0.9.3 | MIT License | github.com/jgthms/bulma */
.breadcrumb {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.breadcrumb:not(:last-child) {
margin-bottom: 1.5rem;
}
/*! minireset.css v0.0.6 | MIT License | github.com/jgthms/minireset.css */
*,
:after,
:before {
box-sizing: inherit;
}
@-webkit-keyframes spinAround {
0% {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}
@keyframes spinAround {
0% {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}
@-webkit-keyframes moveIndeterminate {
0% {
background-position: 200% 0;
}
to {
background-position: -200% 0;
}
}
@keyframes moveIndeterminate {
0% {
background-position: 200% 0;
}
to {
background-position: -200% 0;
}
}
.breadcrumb {
font-size: 1rem;
white-space: nowrap;
}
.breadcrumb a {
align-items: center;
color: #485fc7;
display: flex;
justify-content: center;
padding: 0 0.75em;
}
.breadcrumb a:hover {
color: #363636;
}
.breadcrumb li {
align-items: center;
display: flex;
}
.breadcrumb li:first-child a {
padding-left: 0;
}
.breadcrumb li.is-active a {
color: #363636;
cursor: default;
pointer-events: none;
}
.breadcrumb li + li:before {
color: #b5b5b5;
content: '/';
}
.breadcrumb ol,
.breadcrumb ul {
align-items: flex-start;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
}
.breadcrumb .icon:first-child {
margin-right: 0.5em;
}
.breadcrumb .icon:last-child {
margin-left: 0.5em;
}
.breadcrumb.is-centered ol,
.breadcrumb.is-centered ul {
justify-content: center;
}
.breadcrumb.is-right ol,
.breadcrumb.is-right ul {
justify-content: flex-end;
}
.breadcrumb.is-small {
font-size: 0.75rem;
}
.breadcrumb.is-medium {
font-size: 1.25rem;
}
.breadcrumb.is-large {
font-size: 1.5rem;
}
.breadcrumb.has-arrow-separator li + li:before {
content: '→';
}
.breadcrumb.has-bullet-separator li + li:before {
content: '•';
}
.breadcrumb.has-dot-separator li + li:before {
content: '·';
}
.breadcrumb.has-succeeds-separator li + li:before {
content: '≻';
}

View file

@ -19,13 +19,16 @@
var d = document,
load = function () {
[].forEach.call(d.querySelectorAll(".animated[data-animate]"), function (el) {
if (isInViewport(el)) {
// set image to nothing to clear, then load new
el.classList.add(el.getAttribute("data-animate"));
el.removeAttribute("data-animate");
}
});
[].forEach.call(
d.querySelectorAll('.animated[data-animate]'),
function (el) {
if (isInViewport(el)) {
// set image to nothing to clear, then load new
el.classList.add(el.getAttribute('data-animate'));
el.removeAttribute('data-animate');
}
},
);
};
var isInViewport = function isInViewport(elem) {
@ -43,24 +46,24 @@
};
load();
d.addEventListener("lazy", function () {
d.addEventListener('lazy', function () {
setTimeout(function () {
load();
}, 0);
});
var resetHash = function(){
if(window.location.hash != ""){
history.pushState("", document.title, window.location.pathname + window.location.search);
}
}
d.addEventListener(
"scroll",
function () {
debounce(load(), 200);
debounce(resetHash(), 500);
var resetHash = function () {
if (window.location.hash != '') {
history.pushState(
'',
document.title,
window.location.pathname + window.location.search,
);
}
);
};
d.addEventListener('scroll', function () {
debounce(load(), 200);
debounce(resetHash(), 500);
});
})();

View file

@ -1,5 +1,8 @@
// Get all "navbar-burger" elements
var $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0); // Check if there are any navbar burgers
var $navbarBurgers = Array.prototype.slice.call(
document.querySelectorAll('.navbar-burger'),
0,
); // Check if there are any navbar burgers
if ($navbarBurgers.length > 0) {
// Add a click event on each of them

View file

@ -1,10 +1,11 @@
// Modals
var rootEl = document.documentElement;
var $modals = getAll('.modal');
var $modalButtons = getAll('.modal-button');
var $modalCloses = getAll('.modal-background, .modal-close, .modal-card-head .delete, .modal-card-foot .button');
var $modalCloses = getAll(
'.modal-background, .modal-close, .modal-card-head .delete, .modal-card-foot .button',
);
if ($modalButtons.length > 0) {
$modalButtons.forEach(function ($el) {

View file

@ -1,13 +1,9 @@
// var client = algoliasearch('QFXNLHI6NP', '6b5ccc86ead48e79e587963eeb2d83e8');
// var searchIndex = client.initIndex("dev_atlas");
// var searchBox = document.getElementById("search");
// var searchForm = document.getElementById("search-form");
// var runSearch = function(event) {
// var searchResultsContainer = document.getElementById("search-results");
// searchResultsContainer.textContent = "";
@ -31,7 +27,6 @@
// console.log(results);
// var formattedResults = results.map(function(result){
// var toolName = extractToolName(result._tags);
// console.log(toolName)
@ -98,4 +93,3 @@
// searchBox.addEventListener("input", runSearch.debounce(250));
// searchForm.addEventListener("submit", (e) => e.preventDefault());
// }