Skip to content

Commit

Permalink
build based on cfcfe8c
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 8, 2024
1 parent 809ff61 commit 2d181fd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.12.0-DEV.1169","generation_timestamp":"2024-09-08T13:45:53","documenter_version":"1.7.0"}}
{"documenter":{"julia_version":"1.12.0-DEV.1170","generation_timestamp":"2024-09-08T14:34:19","documenter_version":"1.7.0"}}
4 changes: 2 additions & 2 deletions dev/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
show(stdout, MIME("text/html"), str)
end</code><code class="nohighlight hljs ansi" style="display:block;">Sometimes you might want <span class="sgr38_5" style="color:#afaf00">different</span> <span class="sgr38_5" style="color:#ffaf00">shades</span> of <span class="sgr38_5" style="color:#d78787">colors</span>.

&lt;pre&gt;Sometimes you might want &lt;span style=&quot;color: #b7ba25;&quot;&gt;different&lt;/span&gt; &lt;span style=&quot;color: #fabc2e;&quot;&gt;shades&lt;/span&gt; of &lt;span style=&quot;color: #d2859a;&quot;&gt;colors&lt;/span&gt;.&lt;/pre&gt;</code></pre><h2 id="Composing-and-interpolating-styled-content"><a class="docs-heading-anchor" href="#Composing-and-interpolating-styled-content">Composing and interpolating styled content</a><a id="Composing-and-interpolating-styled-content-1"></a><a class="docs-heading-anchor-permalink" href="#Composing-and-interpolating-styled-content" title="Permalink"></a></h2><p>As you work with more styled content, the ability to compose styled content and styling information is rather useful. Helpfully, StyledStrings allows for interpolation of both content and attributes.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; small_rainbow = (:red, :yellow, :green, :blue, :magenta)</code><code class="nohighlight hljs ansi" style="display:block;">(:red, :yellow, :green, :blue, :magenta)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; color = join([styled&quot;{$f:$c}&quot; for (f, c) in tuple.(small_rainbow, collect(&quot;color&quot;))])</code><code class="nohighlight hljs ansi" style="display:block;">&quot;<span class="sgr38_5" style="color:#f00">c</span><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span>&quot;</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; styled&quot;It&#39;s nice to include $color, and it composes too: {bold,inverse:$color}&quot;</code><code class="nohighlight hljs ansi" style="display:block;">&quot;It&#39;s nice to include <span class="sgr38_5" style="color:#f00">c</span><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span>, and it composes too: <span class="sgr38_5" style="color:#f00"><span class="sgr1">c</span></span><span class="sgr1"><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span></span>&quot;</code></pre><p>Sometimes it&#39;s useful to compose a string incrementally, or interoperate with other <code>IO</code>-based code. For these use-cases, the <a href="@ref Base.AnnotatedIOBuffer"><code>AnnotatedIOBuffer</code></a> is very handy, as you can <a href="@ref Base.read"><code>read</code></a> an <a href="@ref Base.AnnotatedString"><code>AnnotatedString</code></a> from it.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; aio = Base.AnnotatedIOBuffer()</code><code class="nohighlight hljs ansi" style="display:block;">Base.AnnotatedIOBuffer(0 bytes, 0 annotations)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; typ = Int</code><code class="nohighlight hljs ansi" style="display:block;">Int64</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; print(aio, typ)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; while typ != Any # We&#39;ll pretend that `supertypes` doesn&#39;t exist.
Sometimes you might want &lt;span style=&quot;color: #b7ba25&quot;&gt;different&lt;/span&gt; &lt;span style=&quot;color: #fabc2e&quot;&gt;shades&lt;/span&gt; of &lt;span style=&quot;color: #d2859a&quot;&gt;colors&lt;/span&gt;.</code></pre><h2 id="Composing-and-interpolating-styled-content"><a class="docs-heading-anchor" href="#Composing-and-interpolating-styled-content">Composing and interpolating styled content</a><a id="Composing-and-interpolating-styled-content-1"></a><a class="docs-heading-anchor-permalink" href="#Composing-and-interpolating-styled-content" title="Permalink"></a></h2><p>As you work with more styled content, the ability to compose styled content and styling information is rather useful. Helpfully, StyledStrings allows for interpolation of both content and attributes.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; small_rainbow = (:red, :yellow, :green, :blue, :magenta)</code><code class="nohighlight hljs ansi" style="display:block;">(:red, :yellow, :green, :blue, :magenta)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; color = join([styled&quot;{$f:$c}&quot; for (f, c) in tuple.(small_rainbow, collect(&quot;color&quot;))])</code><code class="nohighlight hljs ansi" style="display:block;">&quot;<span class="sgr38_5" style="color:#f00">c</span><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span>&quot;</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; styled&quot;It&#39;s nice to include $color, and it composes too: {bold,inverse:$color}&quot;</code><code class="nohighlight hljs ansi" style="display:block;">&quot;It&#39;s nice to include <span class="sgr38_5" style="color:#f00">c</span><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span>, and it composes too: <span class="sgr38_5" style="color:#f00"><span class="sgr1">c</span></span><span class="sgr1"><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span></span>&quot;</code></pre><p>Sometimes it&#39;s useful to compose a string incrementally, or interoperate with other <code>IO</code>-based code. For these use-cases, the <a href="@ref Base.AnnotatedIOBuffer"><code>AnnotatedIOBuffer</code></a> is very handy, as you can <a href="@ref Base.read"><code>read</code></a> an <a href="@ref Base.AnnotatedString"><code>AnnotatedString</code></a> from it.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; aio = Base.AnnotatedIOBuffer()</code><code class="nohighlight hljs ansi" style="display:block;">Base.AnnotatedIOBuffer(0 bytes, 0 annotations)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; typ = Int</code><code class="nohighlight hljs ansi" style="display:block;">Int64</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; print(aio, typ)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; while typ != Any # We&#39;ll pretend that `supertypes` doesn&#39;t exist.
typ = supertype(typ)
print(aio, styled&quot; {bright_red:&lt;:} $typ&quot;)
end</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; read(seekstart(aio), Base.AnnotatedString)</code><code class="nohighlight hljs ansi" style="display:block;">&quot;Int64 <span class="sgr91">&lt;:</span> Signed <span class="sgr91">&lt;:</span> Integer <span class="sgr91">&lt;:</span> Real <span class="sgr91">&lt;:</span> Number <span class="sgr91">&lt;:</span> Any&quot;</code></pre><p>StyledStrings adds a specialised <a href="@ref"><code>printstyled</code></a> method <code>printstyled(::AnnotatedIOBuffer, ...)</code> that means that you can pass an <code>AnnotatedIOBuffer</code> as IO to &quot;legacy&quot; code written to use <code>printstyled</code>, and extract all the styling as though it had used <a href="../#StyledStrings.StyledMarkup.@styled_str"><code>styled&quot;...&quot;</code></a> macros.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; aio = Base.AnnotatedIOBuffer()</code><code class="nohighlight hljs ansi" style="display:block;">Base.AnnotatedIOBuffer(0 bytes, 0 annotations)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;c&#39;, color=:red)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;o&#39;, color=:yellow)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;l&#39;, color=:green)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;o&#39;, color=:blue)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;r&#39;, color=:magenta)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; read(seekstart(aio), Base.AnnotatedString)</code><code class="nohighlight hljs ansi" style="display:block;">&quot;<span class="sgr38_5" style="color:#f00">c</span><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span>&quot;</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; read(seekstart(aio), String)</code><code class="nohighlight hljs ansi" style="display:block;">&quot;color&quot;</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« StyledStrings</a><a class="docs-footer-nextpage" href="../internals/">Internals »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Sunday 8 September 2024 13:45">Sunday 8 September 2024</span>. Using Julia version 1.12.0-DEV.1169.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; read(seekstart(aio), Base.AnnotatedString)</code><code class="nohighlight hljs ansi" style="display:block;">&quot;Int64 <span class="sgr91">&lt;:</span> Signed <span class="sgr91">&lt;:</span> Integer <span class="sgr91">&lt;:</span> Real <span class="sgr91">&lt;:</span> Number <span class="sgr91">&lt;:</span> Any&quot;</code></pre><p>StyledStrings adds a specialised <a href="@ref"><code>printstyled</code></a> method <code>printstyled(::AnnotatedIOBuffer, ...)</code> that means that you can pass an <code>AnnotatedIOBuffer</code> as IO to &quot;legacy&quot; code written to use <code>printstyled</code>, and extract all the styling as though it had used <a href="../#StyledStrings.StyledMarkup.@styled_str"><code>styled&quot;...&quot;</code></a> macros.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; aio = Base.AnnotatedIOBuffer()</code><code class="nohighlight hljs ansi" style="display:block;">Base.AnnotatedIOBuffer(0 bytes, 0 annotations)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;c&#39;, color=:red)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;o&#39;, color=:yellow)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;l&#39;, color=:green)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;o&#39;, color=:blue)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; printstyled(aio, &#39;r&#39;, color=:magenta)</code><code class="nohighlight hljs ansi" style="display:block;"></code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; read(seekstart(aio), Base.AnnotatedString)</code><code class="nohighlight hljs ansi" style="display:block;">&quot;<span class="sgr38_5" style="color:#f00">c</span><span class="sgr33">o</span><span class="sgr32">l</span><span class="sgr34">o</span><span class="sgr35">r</span>&quot;</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; read(seekstart(aio), String)</code><code class="nohighlight hljs ansi" style="display:block;">&quot;color&quot;</code></pre></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« StyledStrings</a><a class="docs-footer-nextpage" href="../internals/">Internals »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.7.0 on <span class="colophon-date" title="Sunday 8 September 2024 14:34">Sunday 8 September 2024</span>. Using Julia version 1.12.0-DEV.1170.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 2d181fd

Please sign in to comment.