Skip to content

Settings

Arne Westphal edited this page Oct 23, 2018 · 3 revisions

Settings

You can change the settings of this VSCode package by selecting File - Preferences - Settings and search for vsc-elearnjs.

The settings are sorted into groups of similarity and within those alphabetically.

General settings will most likely affect all outputs. HTML and PDF will only affect their specific output. These settings are all global, meaning that they affect all markdown files you convert with vsc-elearnjs.

You can also change into Workspace settings, to only update the settings for the current workspace. The setting vsc-elearnjs.general.export.alwaysDisplayExportOptions might be overwritten if you check/uncheck the box in the Export Option Menu which will be displayed before exporting. This will always only overwrite the global setting. If you set this option to true in the Workspace settings, the checkbox in the OptionMenu will have no effect.

The settings are further described here.

General

  • Always display export options:
    • vsc-elearnjs.general.export.alwaysDisplayExportOptions
    • On export you might be prompted with additional export options
    • Deactivating this option will always reuse your stored defaults
    • To change your stored defaults you have to activate this option again
    • You can also toggle this option via the Package Menu - elearn.js - Always display export options
  • Keep export option defaults after exit:
    • vsc-elearnjs.general.export.keepExportOptions
    • On export you might be prompted with additional export options. Your selected options will be stored as defaults for you next export. This way you can export faster by just confirming your previous options
    • Activate this option to keep this information even after closing VSCode
  • Keep export locations after exit:
    • vsc-elearnjs.general.export.keepSaveLocations
    • On export your selection export location will be stored and reused. This way you are not prompted every time you want to export your file
    • Check this option to keep this stored location even after closing VSCode
    • You can only overwrite your export location by using elearn.js - Save as...
  • Method to detect extensions:
    • vsc-elearnjs.general.extensionDetection.detectExtensionsMethod
    • On export you will be asked which extensions you want to include
    • This method will be used to determine the selected values on prompt. You can always change them before exporting, but it might save you time to select the method which works best for you
    • So you can use the extensions easily there is a mode Automatic which scans the output and looks for extension specific items
    • If you do not want this there are other options:
      • Automatic detection (auto): scans for extension specific elements and activates only those extensions (recommended)
      • Last values (last): will work like other export options. It will always select the values you activated on your last export
      • Always on (on): activates all extensions always
      • Always off (off): deactivates all extensions always
  • Start a new section at headings:
    • vsc-elearnjs.general.section.newSectionOnHeading
    • This will automatically detect headings
    • Only markdown style headings with hashes (#), not underlined headings (= or -)
    • Sections are used by elearn.js to create pages
    • For further information about sections read the sections part in Additions to Markdown Syntax
  • New sections up to depth:
    • vsc-elearnjs.general.section.newSectionOnHeadingDepth
    • Only if Start a new section at headings is on
    • This will define which headings are used to create sections
    • e.g. 3 (H3 - ### Heading) will activate automatic section generation for
      • H1 - # Heading
      • H2 - ## Heading
      • H3 - ### Heading
    • For further information about sections read the sections part in Additions to Markdown Syntax

Section Levels

  • vsc-elearnjs.general.sectionLevels.subsectionLevel
  • and vsc-elearnjs.general.sectionLevels.subSubsectionLevel
  • These options are used for elearn.js section levels
  • There are three levels: Section, Subsection, Subsubsection
  • This sections are only displayed differently in content overviews
  • Create section levels: Activates or deactivates levelling of sections
  • Subsection: The highest heading level to be interpreted as subsection
  • Subsubsection: The highest heading level to be interpreted as subsubsection

PDF

  • Download Chrome:
    • vsc-elearnjs.pdf.chrome.keepChromeAlive
    • If activated, the package will download a bundled Chromium version (if not done already)
    • This version will be used if vsc-elearnjs.pdf.chrome.path is not set
    • If you really want to use your own Chrome with vsc-elearnjs.pdf.chrome.path and do not want to keep the bundled version (of 100-300MB size) you can deactivate this option and set up your Chrome
  • Keep Chrome Running:
    • vsc-elearnjs.pdf.chrome.keepChromeAlive
    • The Chrome process used for PDF conversion will not terminate after every conversion if this option is checked
    • This will increase the conversion speed but also the memory usage of VSCode slightly
    • When deactivating this option, remaining processes of chrome will immediately be stopped
  • Custom Chrome Path:
    • vsc-elearnjs.pdf.chrome.path
    • Since markdown-elearnjs version 1.4.0 Puppeteer is used for PDF conversion. Puppeteer uses a bundled Chromium internally
    • You can insert an absolute path to the chrome executable you want to use
    • This can be used if the bundled chrome does not work for some reason (e.g. on ARM architectures)
    • Only use if you know what you're doing
  • CSS Stylesheet:
    • vsc-elearnjs.pdf.custom.styleFile
    • You can insert an absolute path to add an additional CSS file
    • This file can overwrite elearn.js specific styles for the PDF Output
  • Start a new page at a section start:
    • vsc-elearnjs.pdf.general.newPageOnSection
    • Works with automatically generated sections by Start a new section at headings and the extended syntax described below
  • Delay of HTML rendering:
    • vsc-elearnjs.pdf.general.renderDelay
    • The page is calculated as html in the background and then rendered to pdf
    • Adds a wait time to make sure all the scripts are done
    • The value is in seconds
  • Zoom of PDF Output:
    • vsc-elearnjs.pdf.general.zoom
    • Will zoom all of the content by this factor
    • Can be used e.g. to make the font bigger/smaller
    • 0.5: half the size, 1: no zoom, 2: double the size
    • Can be used as a fix for a zoom issue. See Known Issues
  • Custom header/footer text:
  • Header/Footer height:
    • vsc-elearnjs.pdf.headerAndFooter.footerHeight
    • and vsc-elearnjs.pdf.headerAndFooter.headerHeight
    • Changes internal settings of header and footer height
    • You can use strings like 1.7cm or 12px with units px, mm, cm, in
    • Do not use any spaces

Examples

Custom header/footer text
<div style="text-align: right; padding: 7mm; 10mm">
  <span class="date"></span> - <span class="pageNumber"></span>
</div>

This will create headers or footers like 9/18/2018 - 7.

Clone this wiki locally