You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/tools/vdoc/testdata/output_formats/main.html
+45-11Lines changed: 45 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,29 @@
1
1
<sectionid="readme_main" class="doc-node">
2
2
<divclass="title"><h1> main <ahref="#readme_main">#</a></h1></div>
3
-
<h2>Description</h2><p>This is an example of a an .md file, used for adding more rich text documentation in a project or module.</p><p>This is a <ahref="https://vlang.io/">link</a> to the main V site.</p><p>This is a <b>bold text</b>.</p><p>This is a script <code><script>console.log('hi from README.md');</script></code> .</p><h2>Examples</h2><h3>Functions that return different literals:</h3><p>Example of a function returning boolean:</p><pre><codeclass="language-v"><spanclass="token keyword">fn</span><spanclass="token function">is_odd</span><spanclass="token punctuation">(</span>x <spanclass="token builtin">int</span><spanclass="token punctuation">)</span><spanclass="token builtin">bool</span><spanclass="token punctuation">{</span>
3
+
<h2id="description">Description</h2>
4
+
<p>This is an example of a an .md file, used for adding more rich text documentation in a project or module.</p>
5
+
<p>This is a <ahref="https://vlang.io/">link</a> to the main V site.</p>
6
+
<p>This is a <b>bold text</b>.</p>
7
+
<p>This is a script <code><script>console.log('hi from README.md');</script></code> .</p>
8
+
<h2id="examples">Examples</h2>
9
+
<h3id="functions-that-return-different-literals">Functions that return different literals:</h3>
<spanclass="token punctuation">}</span></code></pre><p>Another example of a function returning a string:</p><pre><codeclass="language-v"><spanclass="token keyword">fn</span><spanclass="token function">answer</span><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token builtin">string</span><spanclass="token punctuation">{</span>
<spanclass="token punctuation">}</span></code></pre><p>This example shows a function returning a string with interpolation:</p><pre><codeclass="language-v"><spanclass="token keyword">fn</span><spanclass="token function">str_with_interplation</span><spanclass="token punctuation">(</span><spanclass="token punctuation">)</span><spanclass="token builtin">string</span><spanclass="token punctuation">{</span>
<spanclass="token keyword">return</span><spanclass="token string"> 'this string has </span><spanclass="token string_interp">$</span>{<spanclass="token number">42</span><spanclass="token punctuation">:</span><spanclass="token number">6</span>}<spanclass="token string"> interpolation in it.'</span>
12
-
<spanclass="token punctuation">}</span></code></pre><h3>Processing command line args</h3><pre><codeclass="language-v"><spanclass="token keyword">import</span> os
<h3id="escape-html-in-strings">Escape html in strings</h3>
100
+
<pre><codeclass="language-v"><spanclass="token keyword">const</span> html <spanclass="token operator">=</span><spanclass="token string">'<!DOCTYPE html>
80
101
<html lang="en">
81
102
<head>
82
103
<style>
@@ -99,20 +120,33 @@ <h2>Description</h2><p>This is an example of a an .md file, used for adding more
99
120
console.log(res);
100
121
}
101
122
</script>
102
-
</html>'</span></code></pre><ul><li>Regular markdown list point 1</li><li>List point 2</li><li>List point 3</li></ul><ol><li>Numbered markdown list point 1</li><li>List point 2</li><li>List point 3</li></ol><p>A code block without a specific language should be rendered verbatim:</p><pre><code>.
123
+
</html>'</span></code></pre>
124
+
<ul>
125
+
<li>Regular markdown list point 1</li>
126
+
<li>List point 2</li>
127
+
<li>List point 3</li></ul>
128
+
<ol>
129
+
<li>Numbered markdown list point 1</li>
130
+
<li>List point 2</li>
131
+
<li>List point 3</li></ol>
132
+
<p>A code block without a specific language should be rendered verbatim:</p>
133
+
<pre><code>.
103
134
├── static/
104
135
│ ├── css/
105
136
│ │ └── main.css
106
137
│ └── js/
107
138
│ └── main.js
108
139
└── main.v
109
-
</code></pre><p>The s tags here in the code block, should be rendered verbatim, not interpreted as HTML ones:</p><pre><code>h:m:s // 5:02:33
140
+
</code></pre>
141
+
<p>The s tags here in the code block, should be rendered verbatim, not interpreted as HTML ones:</p>
0 commit comments