Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Commit

Permalink
Add support for title parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Siavash Safi committed Sep 15, 2017
1 parent ceb0718 commit eff7c33
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/catawiki/jira/prism/Code.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ public String execute(Map<String, Object> parameters, String body, RenderContext
language = parameter;
}
break;
case "title":
templateParams.put("title", (String) entry.getValue());
break;
case "highlight":
case "hl":
templateParams.put("highlight", (String) entry.getValue());
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/soy/prism.soy
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/**
* @param content
* @param? language
* @param? title
* @param? linenumbers
* @param? highlight
* @param? commandline
Expand All @@ -12,13 +13,15 @@
*/
{template .html}
<pre
{if $title} data-line-offset="-1.7" {/if}
{if $linenumbers} class="line-numbers" {/if}
{if $highlight} data-line="{$highlight}" {/if}
{if $commandline} class="command-line" {/if}
{if $user} data-user="{$user}" {/if}
{if $host} data-host="{$host}" {/if}
{if $output} data-output="{$output}" {/if}
>
{if $title}<div data-manual><b>{$title}</b></div><hr style="border: 1px dashed;" data-manual/>{/if}
<code {if $language} class="language-{$language}" {/if}>{$content}</code>
</pre>
{/template}

0 comments on commit eff7c33

Please sign in to comment.