npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

coc-htmldjango

v0.14.13

Published

django templates (htmldjango) extension for coc.nvim. Provides formatter, snippets completion and more...

Downloads

236

Readme

coc-htmldjango

django templates (htmldjango) extension for coc.nvim. Provides "formatter", "linter", "completion" and more...

Features

  • Format
  • Lint
  • Completion
    • Completion of snippets data via completionItemProvider
  • Hover | DEMO
  • CodeAction | DEMO
  • Commands
  • Built-in installer (djLint, DjHTML)

Install

CocInstall:

:CocInstall coc-htmldjango

vim-plug:

Plug 'yaegassy/coc-htmldjango', {'do': 'yarn install --frozen-lockfile'}

Recommended coc-extensions to install together

Tool (linter & formatter) detection

Detection order:

  • htmldjango.djlint.commandPath and htmldjango.djhtml.commandPath settings
  • current python environment (e.g. djlint and djhtml in "venv")
  • builtin djlint and djhtml (Installation commands are also provided)

Configuration options for coc-htmldjango

  • htmldjango.enable: Enable coc-htmldjango extension, default: true
  • htmldjango.completion.enable: Enable snippets completion, default: true
  • htmldjango.completion.exclude: Exclude specific key in snippet completion, default: ["autoescape_paste", "comment_paste", "comment_selection", "for_paste", "forempty_paste", "if_paste", "ifelse_paste", "spaceless_paste", "verbatim_paste", "with_selection", "with_paste", "trans_paste", "blocktrans_paste", "blocktrans_with_paste", "translate_paste", "blocktranslate_paste", "blocktranslate_with_paste"]
  • htmldjango.builtin.pythonPath: Python 3.x path (Absolute path) to be used for built-in install, default: ""
  • htmldjango.formatting.provider: Provider for formatting. Possible options include 'djlint', 'djhtml' and 'none', default: "djlint"
  • htmldjango.djlint.commandPath: The custom path to the djlint (Absolute path), default: ""
  • htmldjango.djlint.enableLint: Enable djLint lint (diagnostics), default: true
  • htmldjango.djlint.lintOnOpen: Lint file on opening, default: true
  • htmldjango.djlint.lintOnChange: Lint file on change, default: true
  • htmldjango.djlint.lintOnSave: Lint file on save, default: true
  • htmldjango.djlint.include: Codes to include (--include), ex: "H014,H017", default: ""
  • htmldjango.djlint.ignore: Codes to ignore (--ignore), ex: "W013,W014", default: ""
  • htmldjango.djlint.ignoreCase: Do not fix case on known html tags (--ignore-case), default: false
  • htmldjango.djlint.ignoreBlocks: Comma list of template blocks to not indent (--ignore-blocks), default: ""
  • htmldjango.djlint.indent: Indent spacing (--indent), default: 4
  • htmldjango.djlint.profile: Enable defaults by template language. ops: html, django, jinja, nunjucks, handlebars, golang and angular, default: ["django"]
  • htmldjango.djlint.useGitIgnore: Use .gitignore file to extend excludes (--use-gitignore), default: false
  • htmldjango.djlint.preserveLeadingSpace: Attempt to preserve leading space on text (--preserve-leading-space), default: false
  • htmldjango.djlint.preserveBlankLines: Attempt to preserve blank lines (--preserve-blank-lines), default: false
  • htmldjango.djlint.formatCss: Also format contents of style tags (--format-css), default: false
  • htmldjango.djlint.formatJs: Also format contents of script tags (--format-js), default: false
  • htmldjango.djlint.addLinterArgs: Additional arguments passed to djlint linter, example: ["--max-line-length", "250", "--max-attribute-length", "80"], default: []
  • htmldjango.djlint.addFormatterArgs: Additional arguments passed to djlint formatter, example: ["--max-line-length", "250", "--max-attribute-length", "80"], default: []
  • htmldjango.djhtml.commandPath: The custom path to the djhtml (Absolute path), default: ""
  • htmldjango.djhtml.tabWidth: Set tabwidth (--tabwidth), default: 4

Commands

  • htmldjango.showOutput: Show htmldjango output channel
  • htmldjango.builtin.installTools: Install htmldjango related tools
  • htmldjango.djlint.format: Run djLint format
  • htmldjango.djhtml.format: Run DjHTML format
  • htmldjango.showReferences: Show Variables Block ({{ ... }}) or TemplateTags Block ({% ... %}) location information for the current file

Code Actions

Example key mapping (Code Action related):

nmap <silent> ga <Plug>(coc-codeaction-line)

Actions:

  • If htmldjango.formatting.provider is djlint or If htmldjango.djlint.enableLint is true
    • Add <!-- djlint:off --> for this line
    • Add <!-- djlint:on --> for this line
  • If htmldjango.formatting.provider is djhtml
    • Add {# fmt:off #} for this line
    • Add {# fmt:on #} for this line

Bult-in install (djLint, DjHTML)

coc-htmldjango allows you to create an extension-only "venv" and install "djlint" and "djhtml".

:CocCommand htmldjango.builtin.installTools

Thanks

License

MIT


This extension is built with create-coc-extension