8000 [Feature] Support HTML, SvelteJS and VueJS by kkoomen · Pull Request #632 · kkoomen/vim-doge · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Feature] Support HTML, SvelteJS and VueJS #632

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 22 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,24 +74,24 @@ Is your favorite language not supported?
Is your favorite doc standard not supported?
[Suggest a new doc standard][suggest-doc-standard] :tada:

| | Language | Doc standards |
| :----------------- | :--------------------------------------------- | :--------------------------------------------------------------------------- |
| :white_check_mark: | Python | [reST][py-rest], [Numpy][py-numpy], [Google][py-google], [Sphinx][py-sphinx] |
| :white_check_mark: | PHP | [phpdoc][phpdoc] |
| :white_check_mark: | JavaScript (Including: ES6, FlowJS and NodeJS) | [JSDoc][jsdoc] |
| :white_check_mark: | TypeScript | [JSDoc][jsdoc] |
| :white_check_mark: | Svelte | [JSDoc][jsdoc] |
| :white_check_mark: | Lua | [LDoc][ldoc] |
| :white_check_mark: | Java | [JavaDoc][javadoc] |
| :white_check_mark: | Groovy | [JavaDoc][javadoc] |
| :white_check_mark: | Ruby | [YARD][yard] |
| :white_check_mark: | C++ | [Doxygen][doxygen] |
| :white_check_mark: | C | [Doxygen][doxygen], [KernelDoc][kerneldoc] |
| :white_check_mark: | C# | [XMLDoc][xmldoc] |
| :white_check_mark: | Bash | [Google][sh-google] |
| :white_check_mark: | Rust | [RustDoc][rustdoc] |
| :white_check_mark: | R | [Roxygen2][roxygen2] |
| :white_check_mark: | Scala | [ScalaDoc][scaladoc] |
| | Language | Doc standards |
| :----------------- | :----------------------------------------------------- | :--------------------------------------------------------------------------- |
| :white_check_mark: | Python | [reST][py-rest], [Numpy][py-numpy], [Google][py-google], [Sphinx][py-sphinx] |
| :white_check_mark: | PHP | [phpdoc][phpdoc] |
| :white_check_mark: | JavaScript (Vanilla, ES6, FlowJS, NodeJS, Svelte, Vue) | [JSDoc][jsdoc] |
| :white_check_mark: | TypeScript | [JSDoc][jsdoc] |
| :white_check_mark: | HTML (through inline `<script>` tags) | [JSDoc][jsdoc] |
| :white_check_mark: | Lua | [LDoc][ldoc] |
| :white_check_mark: | Java | [JavaDoc][javadoc] |
| :white_check_mark: | Groovy | [JavaDoc][javadoc] |
| :white_check_mark: | Ruby | [YARD][yard] |
| :white_check_mark: | C++ | [Doxygen][doxygen] |
| :white_check_mark: | C | [Doxygen][doxygen], [KernelDoc][kerneldoc] |
| :white_check_mark: | C# | [XMLDoc][xmldoc] |
| :white_check_mark: | Bash | [Google][sh-google] |
| :white_check_mark: | Rust | [RustDoc][rustdoc] |
| :white_check_mark: | R | [Roxygen2][roxygen2] |
| :white_check_mark: | Scala | [ScalaDoc][scaladoc] |

# Getting started

Expand Down Expand Up @@ -165,7 +165,7 @@ Here is the full list of available doc standards per filetype:
| `g:doge_doc_standard_python` | `'reST'` | `'reST'`, `'numpy'`, `'google'`, `'sphinx'` |
| `g:doge_doc_standard_php` | `'phpdoc'` | `'phpdoc'` |
| `g:doge_doc_standard_javascript` | `'jsdoc'` | `'jsdoc'` |
| `g:doge_doc_standard_svelte` | `'jsdoc'` | `'jsdoc'` |
| `g:doge_doc_standard_html` | `'jsdoc'` | `'jsdoc'` |
| `g:doge_doc_standard_lua` | `'ldoc'` | `'ldoc'` |
| `g:doge_doc_standard_java` | `'javadoc'` | `'javadoc'` |
| `g:doge_doc_standard_groovy` | `'javadoc'` | `'javadoc'` |
Expand Down Expand Up @@ -221,6 +221,7 @@ Default:
'typescript',
'typescript.tsx',
],
'html': ['svelte', 'vue'],
'java': ['groovy'],
}
```
Expand All @@ -233,11 +234,11 @@ Example:

```vim
let g:doge_filetype_aliases = {
\ 'javascript': ['vue']
\ 'javascript': ['typescript']
\}
```

If you use the above settings and you open `myfile.vue` then it will behave like
If you use the above settings and you open `myfile.ts` then it will behave like
you're opening a JavaScript filetype.

### `g:doge_buffer_mappings`
Expand Down
16 changes: 16 additions & 0 deletions ftplugin/html.vim 8000
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let s:save_cpo = &cpoptions
set cpoptions&vim

" The HTML filetype also gets triggerred for PHP files (and perhaps others).
if &filetype !=? 'html'
finish
endif

let b:doge_parser = 'html'
let b:doge_insert = 'above'

let b:doge_supported_doc_standards = ['jsdoc']
let b:doge_doc_standard = doge#buffer#get_doc_standard('html')

let &cpoptions = s:save_cpo
unlet s:save_cpo
11 changes: 0 additions & 11 deletions ftplugin/svelte.vim

This file was deleted.

Loading
0