Coder Social home page Coder Social logo

jason-fox / fox.jason.prismjs.dark-theme Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 30 KB

Extension of the DITA-OT Prism-JS plug-in to amend the look-and-feel of highlighted code

Home Page: https://jason-fox.github.io/dita-ot-plugins/prismjs

License: Apache License 2.0

CSS 26.01% XSLT 73.99%
dita-ot-plugin dita-ot dita-ot-pdf-plugin dita-ot-html-plugin prismjs html-css css-theme

fox.jason.prismjs.dark-theme's Introduction

Dark Theme CSS for DITA-OT

license DITA-OT 3.7 Quality Gate Status

This is a CSS Theme DITA-OT Plug-in to amend the look-and-feel of highlighted <codeblock> elements. It extends the existing DITA-OT Prism-JS plug-in to amend the CSS colors to align with the Dark Theme from Prism. It can be used as a template for switching to other themes.

Table of Contents

Install

The DITA-OT Dark Theme CSS plug-in has been tested against DITA-OT 3.x. It is recommended that you upgrade to the latest version.

Installing DITA-OT

The Dark Theme CSS plug-in is an override for the standard Prism-JS CSS theme

  • Full installation instructions for downloading DITA-OT can be found here.

    1. Download the dita-ot-3.7.zip package from the project website at dita-ot.org/download
    2. Extract the contents of the package to the directory where you want to install DITA-OT.
    3. Optional: Add the absolute path for the bin directory to the PATH system variable.

    This defines the necessary environment variable to run the dita command from the command line.

curl -LO https://github.com/dita-ot/dita-ot/releases/download/3.7/dita-ot-3.7.zip
unzip -q dita-ot-3.7.zip
rm dita-ot-3.7.zip

Installing the Plug-in

  • Run the plug-in installation commands:
dita install https://github.com/doctales/org.doctales.xmltask/archive/master.zip
dita install https://github.com/jason-fox/fox.jason.extend.css/archive/master.zip
dita install https://github.com/jason-fox/fox.jason.prismjs/archive/master.zip
dita install https://github.com/jason-fox/fox.jason.prismjs.dark-theme/archive/master.zip

The dita command line tool requires no additional configuration.


Usage

Run any HTML dita transform e.g.:

PATH_TO_DITA_OT/bin/dita -f html5 -o out -i document.ditamap

Each HTML output file will include an additional line in the <head>

<head>
    ...
    <link rel="stylesheet" type="text/css" href="common-extended.css">
</head>

common-extended.css will include the dark theme CSS.

Altering the static HTML look and feel

Amend the resource/prism-dark.css file to alter the look-and-feel of the rendered HTML

Additional themes are available here:

Altering the PDF look and feel

The cfg/fo/attrs/prismjs-attr.xsl provides the colors for the PDF output. The names of the attributes match the CSS file.

License

Apache 2.0 © 2019 - 2022 Jason Fox

The Program includes the following additional software components which were obtained under license:

fox.jason.prismjs.dark-theme's People

Contributors

jason-fox avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.