日本語版(外部サイト) / Japanese version(external site)
CodeToHTML is a Visual Studio Code extension that allows you to convert source code to HTML, PDF and images with syntax highlighting.
Visual Studio Code Marketplace
- Open Visual Studio Code
- Press
Ctrl + Shift + X
to open the Extensions view - Find and select
CodeToHTML
- Click the
Install
button
- Convert source code to HTML
- Convert source code to PDF with selectable text
- Convert source code to images (PNG, JPEG, SVG)
For example, you can convert the following JavaScript code to HTML.
- Open the source code file you want to convert
- Open the command palette by pressing
Ctrl + Shift + P
- Type
CodeToHTML
and select[CodeToHTML] Code to HTML
- The Webview will open with the HTML code
- Select Code To
HTML
- From
Structure
select the structure of the HTML - From
Text Wrap
select the text wrapping of the HTML - From
Max Length
select the maximum length of text wrapping
- Select Code To
PDF
- From
Font(.ttf)
select the font file (optional) - From
Text Wrap
select the text wrapping of the PDF - From
Max Length
select the maximum length of text wrapping
- Select Code To
Image
- From
Image Type
select the image type (PNG, JPEG, SVG) - From
Text Wrap
select the text wrapping of the image - From
Max Length
select the maximum length of text wrapping
Initial release of CodeToHTML
This extension is licensed under the MIT License.
- jsPDF - MIT License
- dom-to-image-more - MIT License