remarkable icon indicating copy to clipboard operation
remarkable copied to clipboard

how to use Remarkable's default style

Open printjs opened this issue 9 years ago • 1 comments

I want to know how to use the styles in the sample index.css in demo

printjs avatar Dec 12 '16 08:12 printjs

I found the code.

md.renderer.rules.table_open = function () {
	      return '<table class="table table-striped">\n';
	    };
	    // Inject line numbers for sync scroll. Notes:
	    //
	    // - We track only headings and paragraphs on first level. That's enougth.
	    // - Footnotes content causes jumps. Level limit filter it automatically.
	    //

	    md.renderer.rules.paragraph_open = function (tokens, idx) {
	      var line;
	      if (tokens[idx].lines && tokens[idx].level === 0) {
	        line = tokens[idx].lines[0];
	        return '<p class="line" data-line="' + line + '">';
	      }
	      return '<p>';
	    };
	
	    md.renderer.rules.heading_open = function (tokens, idx) {
	      var line;
	      if (tokens[idx].lines && tokens[idx].level === 0) {
	        line = tokens[idx].lines[0];
	        return '<h' + tokens[idx].hLevel + ' class="line" data-line="' + line + '">';
	      }
	      return '<h' + tokens[idx].hLevel + '>';
	    };

printjs avatar Dec 12 '16 09:12 printjs