Is this just a single person use-case (me) or have wider merit?
As part of:
- a) kakoune
or user implemented
- b) script.kak
I thought I would ask you guys before going down the ‘Feature Request’ path, as I have never officially made one and don’t wish to add to the clutter of issues.
-
a) declaration of document markup tags as part of language filetype.kak.
-
b) user opens a file in the declared mode.
- copies source file to temp file.
- parses the temp file document strings and removes html / markup / other declared tags.
- shows temp file in read-only mode / pager with syntax highlighting based on file extension.
Reading source code files without markup tags in the document strings, demonstration pseudo-code `script.kak`
Updated links have a better regex with a bigger doc-string example.
read only: https://pl.kotl.in/EMhEpMBHH?theme=darcula&readOnly=true
hack-able: https://pl.kotl.in/NZW8Ku2wL
If this can already be done, please tell me.
Cool guys. Bye
Lets say a language code file has document strings with markup like below. I would like to view the code file and authors document strings without the markup noise.
/**
* The {@code StdIn} class provides static methods for reading strings
* and numbers from standard input.
* These functions fall into one of four categories:
* <ul>
* <li>those for reading individual tokens from standard input, one at a time,
* and converting each to a number, string, or boolean
* <li>those for reading characters from standard input, one at a time
* <li>those for reading lines from standard input, one at a time
* <li>those for reading a sequence of values of the same type from standard input,
* and returning the values in an array
* </ul>
* <p>
* Generally, it is best not to mix functions from the different
* categories in the same program.
* <p>
* <b>Getting started.</b>
* To use this class, you must have {@code StdIn.class} in your
* Java classpath. If you used our autoinstaller, you should be all set.
* Otherwise, either download
* <a href = "https://introcs.cs.princeton.edu/java/code/stdlib.jar">stdlib.jar</a>
* and add to your Java classpath or download
* <a href = "https://introcs.cs.princeton.edu/java/stdlib/StdIn.java">StdIn.java</a>
* and put a copy in your working directory.
* <p>
* <b>Reading tokens from standard input and converting to numbers and strings.</b>
* You can use the following methods to read numbers, strings, and booleans
* from standard input one at a time:
* <ul>
* <li> {@link #isEmpty()}
* <li> {@link #readInt()}
* <li> {@link #readDouble()}
* <li> {@link #readString()}
* <li> {@link #readShort()}
* <li> {@link #readLong()}
* <li> {@link #readFloat()}
* <li> {@link #readByte()}
* <li> {@link #readBoolean()}
* </ul>
* <p>
* The first method returns true if standard input has no more tokens.
* Each other method skips over any input that is whitespace. Then, it reads
* the next token and attempts to convert it into a value of the specified
* type. If it succeeds, it returns that value; otherwise, it
* throws an {@link InputMismatchException}.
* <p>
*/
You have given me the alternate thought of just rendering the markup while viewing (easier said than done ).
Ok I’ll check out tools/doc.kak, play with it, and come back next week with some additional thought on this, thanks.
View and play the code in your browser with iframe.
I am enjoying it .
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color:#393834;}
p {color:#f0f0f0; text-align:center;}
h4 {color:#f0f0f0; text-align:center;}
a {color:#ffa500; text-align:center;}
</style>
</head>
<body>
<p>
Press the right hand side <em>`green`</em> play button to execute the demo code in the browser.<br />
Then scroll to the bottom of the page to view the output.<br />
<br /><a href="https://github.com/mawww/kakoune/blob/master/rc/tools/doc.kak" target="_blank">tools/doc.kak</a><br />
<h4>
Reading source code files without markup tags in the document strings, demonstration pseudo-code <em>`script.kak`</em>.
</h4>
<br />
<iframe src="https://pl.kotl.in/EMhEpMBHH?theme=darcula" width="1000px" height="1200px" style="border:none;" name="demo code"></iframe>
</p>
</body>
</html>