Releases: gpoore/codebraid-preview-vscode
v0.17.0
-
Added refresh button to preview (#24).
-
Enabled the find widget in the preview webview. This allows searching
within the preview usingCTRL+F
. -
Improved the appearance of code in the preview. Code block text and the
overall code block regions now have the exact same, correct background
color. Fixed CSS interaction that caused the first line in a code block to
be indented by a very small amount. Improved display of line numbers. -
Updated Markdown CSS from VS Code's built-in Markdown preview. This keeps
the appearance in sync with recent updates to the built-in Markdown preview.
v0.16.0
-
Improved preview compatibility with custom Pandoc HTML templates.
Eliminated dependence on the location and format of ameta
tag with
charset
attribute. Improved error messages for HTML that does not have
expected format (#20). -
The preview now sets the Pandoc template variable
codebraid_preview
to
true
. This makes it possible for custom HTML templates to adapt based on
whether they are being used in the preview. -
Added setting
codebraid.preview.css.useMarkdownPreviewStyles
. This causes
the preview to inherit custom styles (CSS) from the built-in Markdown
preview (markdown.styles
), to maintain a similar appearance (#19). -
Added setting
codebraid.preview.pandoc.preferPandocSourcepos
. This
determines whether Pandoc'ssourcepos
is used (when available) to provide
scroll sync instead of Codebraid Preview'ssourcepos
. Pandoc's
sourcepos
is used by default (when available) because it is usually more
accurate. Codebraid Preview'ssourcepos
can be convenient when working
with filters, since it makes fewer modifications to the AST. -
Improved display of stderr. When the preview HTML has an unsupported format
or is invalid, non-error stderr is no longer displayed. When the input
format ismarkdown_github
, a deprecation warning is only displayed a
single time when the preview initially starts. -
Updated KaTeX to v0.16.9.
v0.15.0
-
Added setting
codebraid.preview.pandoc.executable
(#17). This allows
customizing the location of the Pandoc executable, or using a wrapper
script. -
Added setting
codebraid.preview.pandoc.extraEnv
(#17). This allows
setting additional environment variables for the Pandoc subprocess. -
Added setting
codebraid.preview.pandoc.showStderr
(#17). This allows the
preview to display a notification when Pandoc completes without errors, but
stderr is non-empty. -
Added setting
codebraid.preview.security.pandocDefaultDataDirIsResourceRoot
(#17).
This allows the preview to load resources like images and CSS from
the default Pandoc user data directory. -
The preview now automatically converts local
file:
URIs that point to the
default Pandoc user data directory into VS Code webview URIs
(webview.asWebviewUri()
) that can be loaded within the webview. This only
works whencodebraid.preview.security.pandocDefaultDataDirIsResourceRoot
is enabled (default). -
The Pandoc option
--extract-media
is no longer used to create the preview,
unless the document is a Jupyter notebook. This option was added in v0.14.0
to support Jupyter notebooks, but it creates unnecessary temp image files
for non-notebook documents. -
The preview now provides partial support for the Pandoc option
--embed-resources
. As part of this, added new settings
codebraid.preview.security.allowEmbedded*
. -
Added settings under
codebraid.preview.security
:allowEmbeddedFonts
,
allowEmbeddedImages
,allowEmbeddedMedia
,allowEmbeddedScripts
,
allowEmbeddedStyles
. These determine whether the preview webview's
content security policy allowsdata:
URLs. All aretrue
by default
except forallowEmbeddedScripts
. That is, the preview now automatically
loads embedded fonts, images, media, and styles. -
Added details in README under Security about the implications of the Pandoc
options--embed-resources
and--extract-media
. -
Updated KaTeX to v0.16.6.
v0.14.0
v0.13.0
-
Pandoc 3.1.1 is now the minimum recommended version. The Pandoc version is
now checked when the extension loads, and there are warnings for older
Pandoc versions that do not support all features. -
Added preview support (including scroll sync) for additional Pandoc input
formats:latex
,org
,rst
, andtextile
. The preview displays any
parse errors with a link that jumps to the corresponding source location,
which is particularly useful for LaTeX. -
Added scroll sync support for Markdown variants that are not based on
CommonMark:markdown
,markdown_mmd
,markdown_phpextra
, and
markdown_strict
. Previously, scroll sync was restricted tocommonmark
,
commonmark_x
, andgfm
. -
The preview is now compatible with any text-based document format supported
by Pandoc (including custom Lua readers). Scroll sync is now possible for
any text-based format, regardless of whether Pandoc provides asourcepos
extension. Scroll sync is automatically supported for all Markdown variants
pluslatex
,org
,rst
, andtextile
. Code execution via Codebraid is
still currently limited to formats based on Markdown.For formats not based on CommonMark, scroll sync is enabled with the new
librarysourceposlib.lua
. This uses the AST produced by Pandoc and the
document source to reconstruct a mapping between input and output. It
producessourcepos
-style data for arbitrary text-based document formats.
In some cases, scroll sync may be slightly inaccurate due to the complexity
of reconstructing a source map after parsing. Scroll sync functionality
will be degraded for documents primarily consisting of emoji or other code
points outside the Basic Multilingual Plane (BMP), as well as for documents
primarily consisting of punctuation and symbol code points. Tables with
multi-line cells and footnotes can also interfere with scroll sync under
some circumstances.Support for additional input formats can be added by defining them in the
new settingcodebraid.preview.pandoc.build
. Scroll sync can be enabled
for additional formats by creating a very short Lua reader that wraps the
existing reader. Seescripts/pandoc/readers
for example Lua wrapper
scripts; seescripts/pandoc/lib/readerlib.lua
and
scripts/pandoc/lib/sourceposlib.lua
for additional documentation. -
Document export now provides several default choices for export formats,
instead of simply allowing Pandoc to guess export format based on file
extension. Additional export formats can be defined under the new
settingcodebraid.preview.pandoc.build
. -
The preview now supports
--file-scope
for all Markdown variants, plus
latex
,org
,rst
, andtextile
. This is enabled with the new Lua
reader libraryreaderlib.lua
. Previously,--file-scope
was ignored in
generating the preview. -
Reorganized settings to account for input formats that are not based on
Markdown.codebraid.preview.pandoc.fromFormat
and
codebraid.preview.pandoc.options
are deprecated. They are replaced by
codebraid.preview.pandoc.build
, under property*.md
.
codebraid.preview.pandoc.build
allows each input format to define multiple
preview formats and multiple export formats. Each preview/export format can
define command-line options and also defaults that are saved to a Pandoc
defaults file. -
Setting
codebraid.preview.pandoc.previewDefaultsFile
is deprecated and
replaced withcodebraid.preview.pandoc.defaultsFile
. This makes it
clearer that the defaults file is used for both preview and export. -
Fixed a bug that prevented a preview from starting when a document is open,
but the Panel was clicked more recently than the document. -
Reimplemented configuration processing and updating. Modifying
configuration during preview update, Codebraid execution, or document export
no longer has the potential to result in inconsistent state. -
Removed Julia syntax highlighting customization (#4), since it has been
merged upstream
(microsoft/vscode-markdown-tm-grammar#111).
v0.12.0
-
Pandoc 3.0 compatibility: Updated Lua filters by replacing
pandoc.Null()
withpandoc.Blocks{}
. Minimum supported Codebraid version is now v0.10.3. -
Added new setting
codebraid.preview.css.useMarkdownPreviewFontSettings
.
This causes the preview to inherit font settings (font family, font size,
line height) from the built-in Markdown preview (settings under
markdown.preview
), to maintain a similar appearance. -
Updated preview CSS to include the most recent CSS used by the built-in VS
Code Markdown preview. -
Fixed bug from v0.11.0 that caused error messages from Pandoc to be
displayed incorrectly.
v0.11.0
-
The preview panel now has access to local resources in the workspace
folders, not just access to resources in the document directory. -
Added new setting
codebraid.preview.security.extraLocalResourceRoots
.
This allows the preview panel to load resources such as images from
locations other than the document directory and the workspace folders (#15). -
Reimplemented content security policy and added new related settings under
codebraid.preview.security
(#8, #13).-
The webview content security policy now includes
media-src
. -
There are new settings that determine whether fonts, images, media,
styles, and scripts are allowed from local sources and from remote
sources. By default, local sources are enabled for everything except
scripts. Local access is restricted to the document directory, the
workspace folders, and any additional locations specified under
security.extraLocalResourceRoots
. By default, remote sources are
disabled. Inline scripts are also disabled by default. -
Scripts are now more restricted by default.
script-src
no longer
includesunsafe-inline
or the document directory. Only scripts bundled
with the extension are enabled by default, plus inline scripts from
Pandoc's HTML template (which are enabled via hash). To re-enable inline
scripts, usesecurity.allowInlineScripts
. To re-enable local scripts,
usesecurity.allowLocalScripts
.
-
-
All preview customization to the Pandoc HTML output is now inserted after
rather than before the charset meta tag. This includes the base tag,
content security policy meta tag, and Codebraid scripts. -
Updated KaTeX to v0.16.4.
v0.10.0
-
Added new settings
codebraid.preview.css.useDefault
and
codebraid.preview.css.overrideDefault
for controlling whether the default
preview CSS is loaded and whether it is overridden by document CSS.
Document CSS now has precedence by default (#14). -
A Codebraid Preview defaults file now has precedence over the extension's
Pandoc settings. -
Updated KaTeX to v0.16.3.
v0.9.0
-
The preview Pandoc AST is now preprocessed before any user filters are
applied. AdjacentStr
nodes that are wrapped indata-pos
spans as a
result of thesourcepos
extension are now merged.sourcepos
splits text
that normally would have been in a singleStr
node into multipleStr
nodes, and then wraps each in adata-pos
span. The preprocessing makes
user filters behave as closely as possible to the non-sourcepos
case (#9). -
Added details about
commonmark_x
, including LaTeX macro expansion, to
README (#10). -
When the Codebraid process fails and there is stderr output, the full
details are now written to the Output log.
v0.8.0
-
_codebraid_preview.yaml
now supports essentially all
Pandoc defaults options
and no longer limits the characters allowed in filter file names (#2).
Previously, onlyinput-files
,input-file
,from
, andfilters
were
supported. -
The "Codebraid Preview" button in the status bar now only appears when a
Markdown document is open and visible, and does not yet have a preview.
Previously, after the extension loaded, the button was visible for
non-Markdown files and was also visible if the info panel was open. -
Fixed a bug that prevented YAML metadata from working with Codebraid.
-
Fixed a bug that prevented identification of inherited languages (for
example, with.cb-paste
).