asciidoctor / asciidoctor-vscode

AsciiDoc support for Visual Studio Code using Asciidoctor
Other
321 stars 97 forks source link

Preview render is fixed width #851

Closed itewk closed 3 months ago

itewk commented 4 months ago

When opening preview view the document width is fixed vs when publishing to html the document width is 100%.

I have tried unchecking the ASsciidoc > Preview: Use Editor Style option but that didn't seem to change anything.

I can't tell if this is a bug or if i am missing some setting to get the preview to render the same way the HTML pubish does.

ggrossetie commented 3 months ago

What do you mean by the document width is 100%?

image

Asciidoctor built-in/default style has a max-width with margin: auto.

itewk commented 3 months ago

im saying when i do an asciidoc myfile.adoc and it generates an html file, then the widith consumes the entire browser area, but the preview in the plugin, is fixed width like you have pictured.

ggrossetie commented 3 months ago

asciidoc is the legacy processor for AsciiDoc: https://asciidoc-py.github.io/ This extension is using Asciidoctor. I guess you can provide a custom CSS if you want to remove the max-width.

Closing since this is intended. Please ask usage question at https://asciidoctor.zulipchat.com/

itewk commented 3 months ago

Instructions for providing the custom css somewhere?

ggrossetie commented 3 months ago

ℹ️ README: https://github.com/asciidoctor/asciidoctor-vscode#how-to-use

itewk commented 3 months ago

@ggrossetie took me a sec to figure out the settings, but got it working. thanks.

for anyone else who stumbles on this:

/* import default asciidoc style sheets */
@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700";
@import "https://cdn.jsdelivr.net/gh/asciidoctor/asciidoctor@2.0/data/stylesheets/asciidoctor-default.css";

/* get rid of max-width */
#header,#content,#footnotes,#footer{
    max-width:none;
}