Customizing Markdown preview
Oxygen general issues.
Customizing Markdown preview
Hi.
I'd like to customize the Markdown preview, but I can't figure out what CSS is responsible for it and how to extend it.
Inspecting a .md file in the properties view doesn't show it as being associated with a framework:
So how should one go about customizing the markdown preview?
Many thanks in advance.
All best,
Toma
I'd like to customize the Markdown preview, but I can't figure out what CSS is responsible for it and how to extend it.
Inspecting a .md file in the properties view doesn't show it as being associated with a framework:
So how should one go about customizing the markdown preview?
Many thanks in advance.
All best,
Toma
Re: Customizing Markdown preview
Hi Toma,
The main CSS for Markdown preview for the DITA and Lightweight DITA tabs is located in "OXYGEN_INSTALL_DIR/frameworks/dita/css/edit/preview-md.css".
The main CSS for Markdown preview for the HTML tab is located in "OXYGEN_INSTALL_DIR/frameworks/xhtml/css/xhtml-md.css".
Regards,
Radu
The main CSS for Markdown preview for the DITA and Lightweight DITA tabs is located in "OXYGEN_INSTALL_DIR/frameworks/dita/css/edit/preview-md.css".
The main CSS for Markdown preview for the HTML tab is located in "OXYGEN_INSTALL_DIR/frameworks/xhtml/css/xhtml-md.css".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Re: Customizing Markdown preview
Thanks Radu. Indeed, I can change the look of the html Markdown Preview if I tinker with the CSS in the XHTML framework inside oXygen installation. But I would like to extend the XHTML framework and set up my CSS in the extended framework so that it can be shared together with our other project files.
I did the usual thing for extending frameworks (i do it already for TEI and ODD), I set up an additional stylesheet in the extended framework, but this stylesheet doesn't seem to take effect. The Markdown preview doesn't include an inspect styles option, the way Author View does, so I can't really tell what's wrong and why my CSS rules aren't getting picked up.
Any additional tips you may have for me? How does oXygen know to associate the Markdown HTML Preview with the XHTML framework?
All best,
Toma
I did the usual thing for extending frameworks (i do it already for TEI and ODD), I set up an additional stylesheet in the extended framework, but this stylesheet doesn't seem to take effect. The Markdown preview doesn't include an inspect styles option, the way Author View does, so I can't really tell what's wrong and why my CSS rules aren't getting picked up.
Any additional tips you may have for me? How does oXygen know to associate the Markdown HTML Preview with the XHTML framework?
All best,
Toma
Re: Customizing Markdown preview
Hi Toma,
This is not straight forward but possible.
Oxygen tries to load the CSS directly from the "oxygen_install_dir/frameworks/xhtml/css/xhtml-md.css" location but before doing so it passes the path through its XML catalog support.
For example if you create a custom XHTML extension framework folder somewhere on your disk, it could contain inside a "catalog.xml" looking something like this:
and next to the catalog.xml a md-preview.css with the content something like this:
Oxygen's CSS validation will report the CSS as invalid but Oxygen can actually properly read the import when the CSS is used for visual editing.
So in the Oxygen Preferences->"Document Type Associations" page if you edit your XHTML framework extension, in the "Catalogs" tab you can add a reference to ${framework}/catalog.xml and Oxygen should start passing through your XML catalog when looking for the "xhtml-md.css".
The Markdown XHTML preview tab has some caches in place so you may need to reopen Oxygen after you change the custom preview CSS.
Regards,
Radu
This is not straight forward but possible.
Oxygen tries to load the CSS directly from the "oxygen_install_dir/frameworks/xhtml/css/xhtml-md.css" location but before doing so it passes the path through its XML catalog support.
For example if you create a custom XHTML extension framework folder somewhere on your disk, it could contain inside a "catalog.xml" looking something like this:
Code: Select all
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<uriSuffix uriSuffix="xhtml-md.css" uri="md-preview.css"/>
</catalog>
Code: Select all
@import "${framework(XHTML)}/css/xhtml.css";
@namespace oxy "http://www.oxygenxml.com/extensions/author";
oxy|processing-instruction {
display:none !important;
}
head:empty {
display:none;
}
So in the Oxygen Preferences->"Document Type Associations" page if you edit your XHTML framework extension, in the "Catalogs" tab you can add a reference to ${framework}/catalog.xml and Oxygen should start passing through your XML catalog when looking for the "xhtml-md.css".
The Markdown XHTML preview tab has some caches in place so you may need to reopen Oxygen after you change the custom preview CSS.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service