asciidoctor: how to provide source-highlighter JavaScript File offline - asciidoctor

I use Asciidoctor for our User Guide. A requirement is that there is no access to the internet for the users.
I use prettify:
:source-highlighter: prettify
This creates in the HTML:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.min.js"></script>
<script>prettyPrint()</script>
What I need is something, like
<link rel="stylesheet" href="assets/css/prettify.min.css">
<script src="assets/js/prettify.min.js"></script>
<script>prettyPrint()</script>
Is there a way to achieve this?

After looking at the source you can specify
:prettifydir: assets
to receive an HTML output of
<link rel="stylesheet" href="assets/prettify.min.css">
<script src="assets/run_prettify.min.js"></script>
To make it work for your users, you'll need to put the referenced files at the location yourself; Asciidoctor won't do that for you AFAIK.

Use asciidoctor-rouge or asciidoctor-highlight.js.

Related

MDC-Web: How to Setup MDC-Web Vanilla

I'm using a basic file manager to maintain my webpages files. How to I begin using MDC-Web Vanilla?
In the MDC-Web Github project folder are: README.md, index.js, material-components-web.scss, and package.json.
I would expect to find <link> and <script> elements to add to MDC-Web to my project, similar to how MDL and Bootstrap work. Where do I find those?
This works. You need to attach/initialize JS on some components/elements.
<link rel="stylesheet" href="https://unpkg.com/material-components-web#latest/dist/material-components-web.min.css">
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:100,300,400,700,900">
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
<script src="https://unpkg.com/material-components-web#latest/dist/material-components-web.min.js"></script>

How to make a browser download external files after having loaded a page?

Alright, my question is pretty simple. Suppose I have a homepage that is not linked to any external stylesheets, all its styles being either inline or internal, how do I do so that AFTER the homepage has been downloaded and displayed, the browser then downloads any necessary (specified) external stylesheets. Is this possible?
Thank you.
Try This:
<head>
<script type='text/javascript'>
function addstyle()
{
document.getElementById('style').href='style.css';
}
</script>
<link rel="stylesheet" type="text/css" href="">
</head>
<body onload="addstyle()">
<h1>Welcome</h1>
<p>Hello whats up</p>
<p>Hope you will have a great day</p>
</body>

Enable HTML code only in Dreamweaver's Designer

I need some HTML code to be processed only by Dreamweaver's Designer.
To be more exact, I need smth. like this:
<html>
...
<link rel="stylesheet" type="text/css" media="screen" href="styles_print.css" title="printer_friendly_css" />
<!-- FOR_DREAMWEAVER_DESIGNER_ONLY
<link rel="stylesheet" type="text/css" media="screen" href="styles.css" title="normal_css" />
-->
...
</html>
So that when this page is being viewed in Dreamweaver's Designer, the effective HTML looks like this (second tag is "uncommented"):
<html>
...
<link rel="stylesheet" type="text/css" media="screen" href="styles_print.css" title="printer_friendly_css" />
<link rel="stylesheet" type="text/css" media="screen" href="styles.css" title="normal_css" />
...
</html>
and when the same page is being viewed somewhere else (e.g. in regular browser), it is processed as it should be (second tag is ignored because it is commented).
Is this possible? Does Dreamweaver have this kind of feature?
Dreamweaver has a feature called Design Time Style sheets to handle this type of functionality. It allows you to apply styles only within Dreamweaver not on the live page. You can even hide styles at design time that would be present live.
Format -> CSS Styles -> Design-time
Adobe help for Design time style sheets:
http://help.adobe.com/en_US/dreamweaver/cs/using/WScbb6b82af5544594822510a94ae8d65-7e17a.html
You can even use design time style sheets to help you track down potential problems with your CSS. Here's an article I wrote a while a go about that topic:
http://www.webassist.com/free-downloads/tutorials-and-training/roadmaps/roadmap_07.php
If you're using PHP and you want to apply site-wide and you have an include that is in every page take a look at:
http://james.revillini.com/2008/01/24/solved-dreamweaver-site-wide-design-time-style-sheets-using-templates/
Dreamweaver extension that can apply them site wide (Commercial, but only $5, haven't tried in in several versions of Dreamweaver, but I think it should still work):
http://www.communitymx.com/abstract.cfm?cid=61265

Application Relative Paths IIS

I'm moving an web application to a subdirectory from it's root and having issues with paths.
Old: http://www.domain.com/
New: http://www.domain.com/app/
All of the include css, scripts and html links where in this format:
<link rel="stylesheet" type="text/css" href="/styles/menu.css" media="screen"/>
I've changed to:
<link rel="stylesheet" type="text/css" href="./styles/menu.css" media="screen"/>
or
<link rel="stylesheet" type="text/css" href="~/styles/menu.css" media="screen"/>
It works fine on links and others until I go one directory deep where links and paths are broken.
e.g.
www.domain.com/app/dir1/
www.domain.com/app/dir2/
There the link url or others (scripts, includes, etc) get duplicate paths.
e.g.
www.domain.com/app/dir1/dir1/
www.domain.com/app/dir2/dir2/
How could I approach this as absolute?
Using ~/style... etc is the easiest solution in ASP.NET but you must put runat="server" in the tag for it to actually work

How to embed a javascript/jquery file in ExpressionEngine?

I need to embed jquery files in ExpressionEngine.
I have created the template js under the main site template group.
I know that the css is embedding with the following tag:
<link rel="stylesheet" href="{stylesheet=template_group/template}" type="text/css" media="screen" />
for css its {stylesheet=template_group/template}
I want to know what is the tag for embedding js files
<script src=" [-->> ?? <<--] " type="text/javascript"></script>
Just make sure that your template containing your javascript is of the "JavaScript" type, and link it using the standard path syntax:
<script src="{path="scripts/myscript"}" type="text/javascript"></script>

Resources