Hello,

Thank you for sharing your solution.

I'm not quite sure I finally understood what you want.

Is your real need to deploy HTML pages generated from asciidoc on a github project?
Or the asciidoc source themselves?

I can't understand how the two-way button you wrote below would actually work two ways, if the "blob" URL shows a github page with document source, instead of the document itself. Or perhaps you see something different because your browser runs specific extensions that change behavior when visiting github pages?

Interesting references:
https://stackoverflow.com/questions/8446218/how-to-see-an-html-page-on-github-as-a-normal-rendered-html-page-to-see-preview
https://github.com/ReScience/rescience.github.io/issues/44

To put it another way, if you don't have any solution to your question, and you just deploy things without any specific step, in what way will it be unsatisfying?

Thanks.


Le 2018-10-15 à 12:17, rdp via asciidoc a écrit :

Just for the log / other readers: embedding JavaScript in AsciiDoc works fine (thanks for the link, Lex!).

The following AsciiDoc content adds two Buttons:

 1. This one reads the current document URL, replaces /raw/ by /blob/
    and then opens the new link:
    |
    // Add a button to always open the blob version
    ++++
    <button type="button"onclick="var URL =
    window.location.href;window.open(URL.replace('/raw/',
    '/blob/'));">Openblob</button>
    ++++

    |

 2. This Button opens the other view: if the current document URL
    contains /raw/, then the /blob/ version is opened and vice versa:
    |
    // Add a button to switch between the blob and raw version
    ++++
    <button type="button"onclick="var URL = window.location.href;
    NewURL = (URL.indexOf('/blob/') ? URL.replace('/raw/', '/blob/') :
    URL.replace('/blob/', '/raw/'));
    window.open(NewURL);">Openother View</button>
    ++++
    |


--
You received this message because you are subscribed to the Google Groups "asciidoc" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected] <mailto:[email protected]>. To post to this group, send email to [email protected] <mailto:[email protected]>.
Visit this group at https://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/d/optout.


--
Stéphane Gourichon 06 03 34 84 21

--
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/asciidoc.
For more options, visit https://groups.google.com/d/optout.

Reply via email to