├── docs ├── .nojekyll ├── images │ ├── logo.png │ ├── example.png │ ├── rulers1.gif │ ├── wcempty.png │ ├── example1.png │ ├── autoWrapExample.gif │ ├── example-smaller.png │ ├── wholeCommentFalse.png │ ├── wholeCommentTrue.png │ ├── editToggleAutoWrap.png │ ├── vsAutoWrapStatusBar.png │ ├── switch-to-prerelease.png │ ├── toggleAutoWrapCommand.png │ ├── vsc-autowrap-icon-off.png │ ├── vsc-autowrap-icon-on.png │ ├── vsc-autowrap-settings.png │ ├── vscAutoWrapStatusBar.png │ ├── vsc-autowrap-icon-tempon.png │ ├── vsc-autowrap-icon-tempoff.png │ ├── logo.svg │ ├── example.svg │ └── example1.svg ├── specs │ ├── content-types │ │ ├── proto.md │ │ ├── tcl.md │ │ ├── r.md │ │ ├── prolog.md │ │ ├── lean.md │ │ ├── d.md │ │ ├── zig.md │ │ ├── markdown │ │ │ ├── html.md │ │ │ ├── comments.md │ │ │ ├── indented-code-blocks.md │ │ │ ├── tables.md │ │ │ ├── headings.md │ │ │ ├── blockquotes.md │ │ │ ├── linkrefdefs.md │ │ │ ├── footnotes.md │ │ │ ├── paragraphs.md │ │ │ ├── thematic-breaks.md │ │ │ ├── front-matter.md │ │ │ ├── fenced-code-blocks.md │ │ │ └── lists.md │ │ ├── matlab.md │ │ ├── batch-file.md │ │ ├── dart.md │ │ ├── julia.md │ │ ├── yaml.md │ │ ├── lua.md │ │ ├── octave.md │ │ ├── doxygen.md │ │ ├── graphql.md │ │ ├── elixir.md │ │ ├── go.md │ │ ├── html.md │ │ ├── plaintext.md │ │ ├── restructuredtext │ │ │ ├── enumerated-lists.md │ │ │ ├── field-lists.md │ │ │ ├── doctest-blocks.md │ │ │ ├── bullet-lists.md │ │ │ └── literal-blocks.md │ │ ├── dotnet-xmldoc.md │ │ └── python.md │ ├── features │ │ ├── embedded-sections.md │ │ ├── misc.md │ │ ├── double-sentence-spacing.md │ │ ├── tabs.md │ │ ├── special-characters.md │ │ ├── spaces.md │ │ ├── decoration-lines.md │ │ ├── block-comments.md │ │ ├── line-comments.md │ │ └── selections.md │ └── README.md ├── README.md ├── prerelease-versions.md ├── extra-features.md ├── extra.css └── configuration-visual-studio.md ├── do.cmd ├── do ├── vs ├── logo.png ├── Properties │ └── AssemblyInfo.cs ├── source.extension.vsixmanifest ├── RewrapPackage.vsct └── RewrapPackage.cs ├── vscode ├── logo.png ├── .vscodeignore ├── tsconfig.json ├── test │ ├── fixture │ │ └── .vscode │ │ │ └── settings.json │ ├── run.cjs │ └── tests.cjs ├── LICENSE ├── .eslintrc.yml ├── src │ ├── CustomLanguage.ts │ ├── Core.ts │ ├── Extension.ts │ └── Settings.ts └── package.json ├── core ├── Parsing.Comments.fs ├── package.json ├── test │ └── package.json ├── Core.Test.fsproj ├── Native.js ├── Parsing.Language.fs ├── Core.fsproj ├── Types.fs ├── Parsing.SourceCode.fs ├── Parsing.Sgml.fs ├── Block.fs ├── Main.fs ├── Columns.fs ├── Parsing.DocComments.fs ├── Parsers.fs └── Nonempty.fs ├── .config └── dotnet-tools.json ├── .editorconfig ├── .github ├── issue_template.md └── workflows │ └── main.yml ├── .gitignore ├── .vscode ├── specs.code-snippets ├── settings.json ├── tasks.json └── launch.json ├── LICENSE ├── package.json ├── Rewrap.sln ├── mkdocs.yml └── README.md /docs/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /do.cmd: -------------------------------------------------------------------------------- 1 | @node .config/do.mjs %* 2 | -------------------------------------------------------------------------------- /do: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | node .config/do.mjs "$@" 3 | -------------------------------------------------------------------------------- /vs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/vs/logo.png -------------------------------------------------------------------------------- /vscode/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/vscode/logo.png -------------------------------------------------------------------------------- /docs/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/logo.png -------------------------------------------------------------------------------- /docs/images/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/example.png -------------------------------------------------------------------------------- /docs/images/rulers1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/rulers1.gif -------------------------------------------------------------------------------- /docs/images/wcempty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/wcempty.png -------------------------------------------------------------------------------- /core/Parsing.Comments.fs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/core/Parsing.Comments.fs -------------------------------------------------------------------------------- /docs/images/example1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/example1.png -------------------------------------------------------------------------------- /docs/images/autoWrapExample.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/autoWrapExample.gif -------------------------------------------------------------------------------- /docs/images/example-smaller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/example-smaller.png -------------------------------------------------------------------------------- /docs/images/wholeCommentFalse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/wholeCommentFalse.png -------------------------------------------------------------------------------- /docs/images/wholeCommentTrue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/wholeCommentTrue.png -------------------------------------------------------------------------------- /docs/images/editToggleAutoWrap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/editToggleAutoWrap.png -------------------------------------------------------------------------------- /docs/images/vsAutoWrapStatusBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/vsAutoWrapStatusBar.png -------------------------------------------------------------------------------- /docs/images/switch-to-prerelease.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/switch-to-prerelease.png -------------------------------------------------------------------------------- /docs/images/toggleAutoWrapCommand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/toggleAutoWrapCommand.png -------------------------------------------------------------------------------- /docs/images/vsc-autowrap-icon-off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/vsc-autowrap-icon-off.png -------------------------------------------------------------------------------- /docs/images/vsc-autowrap-icon-on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/vsc-autowrap-icon-on.png -------------------------------------------------------------------------------- /docs/images/vsc-autowrap-settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/vsc-autowrap-settings.png -------------------------------------------------------------------------------- /docs/images/vscAutoWrapStatusBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/vscAutoWrapStatusBar.png -------------------------------------------------------------------------------- /docs/images/vsc-autowrap-icon-tempon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/vsc-autowrap-icon-tempon.png -------------------------------------------------------------------------------- /docs/images/vsc-autowrap-icon-tempoff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dnut/Rewrap/HEAD/docs/images/vsc-autowrap-icon-tempoff.png -------------------------------------------------------------------------------- /vscode/.vscodeignore: -------------------------------------------------------------------------------- 1 | ** 2 | 3 | # Whitelist 4 | !dist/** 5 | !LICENSE 6 | !logo.png 7 | !package.json 8 | !package-lock.json 9 | !README.md 10 | -------------------------------------------------------------------------------- /docs/specs/content-types/proto.md: -------------------------------------------------------------------------------- 1 | > language: "proto" 2 | 3 | // a b c -> // a b ¦ 4 | // d ¦ // c d ¦ 5 | x x x x x x x x x x 6 | -------------------------------------------------------------------------------- /core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "module", 3 | "module": "dist/index.js", 4 | "source": "dist/dev/Main.js", 5 | "engines": { 6 | "node": ">=14.x" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/specs/content-types/tcl.md: -------------------------------------------------------------------------------- 1 | > language: "tcl" 2 | 3 | # a b c -> # a b ¦ 4 | # d ¦ # c d ¦ 5 | z y x w z y x w 6 | v u ¦ v u ¦ 7 | -------------------------------------------------------------------------------- /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "fable": { 6 | "version": "3.6.2", 7 | "commands": [ 8 | "fable" 9 | ] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*] 2 | end_of_line=lf 3 | guidelines = 90 1px solid 77777799 4 | 5 | [*.{cs,fs}] 6 | indent_style = space 7 | insert_final_newline=true 8 | 9 | [*.cs] 10 | tab_width=4 11 | 12 | [*.fs] 13 | tab_width=2 14 | -------------------------------------------------------------------------------- /docs/specs/content-types/r.md: -------------------------------------------------------------------------------- 1 | > language: "r" 2 | 3 | # a b c -> # a b ¦ 4 | # d ¦ # c d ¦ 5 | 6 | ROxygen comments 7 | 8 | #' a b c -> #' a b ¦ 9 | #' d ¦ #' c d ¦ 10 | -------------------------------------------------------------------------------- /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | 7 | -------------------------------------------------------------------------------- /docs/specs/content-types/prolog.md: -------------------------------------------------------------------------------- 1 | > language: "prolog" 2 | 3 | % a b c -> % a b ¦ 4 | % d ¦ % c d ¦ 5 | 6 | /* a b c -> /* a b ¦ 7 | d ¦ c d ¦ 8 | */ ¦ */ ¦ 9 | -------------------------------------------------------------------------------- /core/test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "prod": "prod.js", 3 | "main": "../dist/dev/Tests.js", 4 | "engines": { 5 | "node": ">=14.x" 6 | }, 7 | "targets": { 8 | "prod": { 9 | "source": "../dist/dev/Tests.js" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.vs/ 2 | *.csproj.user 3 | /.ionide/ 4 | /.vscode-test/ 5 | /.obj/ 6 | 7 | /node_modules/ 8 | /vscode/node_modules/ 9 | 10 | /core/dist/ 11 | /core/test/prod.js* 12 | /vscode/dist/ 13 | /vscode/README.md 14 | bin/ 15 | obj/ 16 | /venv 17 | .parcel-cache 18 | rewrap-*.vsix 19 | -------------------------------------------------------------------------------- /vscode/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ "src/Extension.ts" ], 3 | "compilerOptions": { 4 | "module": "commonjs", 5 | "esModuleInterop": true, 6 | "target": "es2019", 7 | "lib": ["ES2019"], 8 | "outDir": "bin", 9 | "sourceMap": true, 10 | "alwaysStrict": true, 11 | "strictNullChecks": true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /docs/specs/content-types/lean.md: -------------------------------------------------------------------------------- 1 | > language: "lean" 2 | 3 | -- a b c -> -- a b ¦ 4 | -- d ¦ -- c d ¦ 5 | x x x x x x x x x x 6 | /- a b c /- a b ¦ 7 | d ¦ c d ¦ 8 | -/ ¦ -/ ¦ 9 | x x x x x x x x x x 10 | -------------------------------------------------------------------------------- /docs/specs/features/embedded-sections.md: -------------------------------------------------------------------------------- 1 | # Embedded Sections 2 | 3 | > language: "html" 4 | 5 | In eg an HTML file, an embedded script section must behave the same if there is 6 | no closing tag, as if there were one. 7 | 8 | ¦ ¦ 49 | 50 | ¦ ¦ 58 | 59 | ¦ -> ¦ 60 | // one two three // one two ¦ 61 | // four ¦ three // four¦ 62 | ¦ ¦ 63 | -------------------------------------------------------------------------------- /docs/specs/content-types/plaintext.md: -------------------------------------------------------------------------------- 1 | # PlainText 2 | 3 | `plaintext` is the most basic content type. Paragraphs are only separated by blank lines. 4 | This documents also details basic wrapping behavior. 5 | 6 | > language: "plaintext" 7 | 8 | Long lines are split at whitespace and wrapped. 9 | 10 | A long line. -> A long ¦ 11 | ¦ line. ¦ 12 | 13 | Short lines are concatenated and then wrapped as appropriate. 14 | 15 | Three. ¦ -> Three. Short. ¦ 16 | Short. ¦ Lines. ¦ 17 | Lines. ¦ 18 | 19 | Words that are longer than the wrapping width (like URLs) will be put on a new 20 | line but won't be broken up. 21 | 22 | Go to www.example.com -> Go to ¦ 23 | ¦ www.example.com 24 | 25 | Paragraphs are separated by blank lines. 26 | 27 | Foo bar baz. -> Foo bar ¦ 28 | ¦ baz. ¦ 29 | Foo ¦ ¦ 30 | bar. ¦ Foo bar. ¦ 31 | 32 | The indent of all lines is kept as is was: 33 | 34 | one two three one two ¦ 35 | four five six -> three four¦ 36 | seven eight¦ five six ¦ 37 | ¦ seven eight¦ 38 | 39 | ## PlainText-IndentSeparated 40 | 41 | With the `plaintext-indentseparated` processor, a difference in line indent *does* start a 42 | new paragraph. 43 | 44 | > language: plaintext-indentseparated 45 | 46 | Foo bar baz. Foo bar ¦ 47 | Foo ¦ -> baz. ¦ 48 | bar. ¦ Foo bar. ¦ 49 | 50 | Paragraph ¦ Paragraph one.¦ 51 | one. ¦ Paragraph ¦ 52 | Paragraph two. -> two. ¦ 53 | Paragraph three. Paragraph ¦ 54 | ¦ three. ¦ 55 | 56 | Also works with tab characters. In the case of mixed spaces and tabs, it's the *indent 57 | width* that counts, not the actual characters. 58 | 59 | > language: plaintext-indentseparated, tabWidth: 2 60 | 61 | Paragraph one. ¦ Paragraph one. ¦ 62 | -→Paragraph ¦ -> -→Paragraph two.¦ 63 | ··two. ¦ ·Paragraph ¦ 64 | ·Paragraph three. ·three. ¦ 65 | -------------------------------------------------------------------------------- /docs/specs/content-types/markdown/footnotes.md: -------------------------------------------------------------------------------- 1 | > language: "markdown" 2 | 3 | Footnotes are not to be confused with [link reference definitions](linkrefdefs.md). 4 | 5 | Footnotes are not in the CommonMark spec, but are supported by a variety of other flavors 6 | of markdown, including GFM, (PHP) Markdown Extra, MultiMarkdown and Pandoc. These all have 7 | slight differences, so until Rewrap offers support for multiple markdown specs, it tries 8 | to cover everything as best it can. 9 | 10 | A footnote is a section beginning with `[^