Confluence macro for specifying a reference, source of the quotation, etc.? - confluence

Is there a way in Confluence for specifying a reference to a text passage — for example, to provide the source of the quoted text, in a similar way as is done on Wikipedia, so that it's rendered like this:
Lorem ipsum dolor sit amet1
[down the page]
1 Cicero
Ideally, the subscript "1" should be an internal hyperlink

I believe this plugin may help: https://marketplace.atlassian.com/plugins/com.adaptavist.confluence.footnotes
The footnotes plugin allows you to quickly and easily add footnote
references to your wiki pages.
You can:
Define Footnotes - Define any number of footnotes throughout your content
Display Footnotes - Display a table of footnotes anywhere in the page
Quickly move between content and footnotes with a click of the mouse

You can do it using anchors:
Pros:
It is native in Confluence
Cons:
It is a very manual procedure (no automatic numbering, etc.)

Related

How to give name to quotation blocks in emacs org-mode

I have created a quote with the following syntax
#+BEGIN_QUOTE
My quote....
#+END_QUOTE
The problem is that in the collapsed view (when only titles and top-level outlines are shown), I see
#+BEGIN_QUOTE...
Which does not properly inform of the content of the quote. Is there a way to give a name or label to the quote so that I can see something like the below instead:
Quote from Jack...
Thank you
You can give names to blocks, whether those blocks are quote blocks, source blocks or any other kind (you can also give names to tables). The advantage is that each quote block can have its own name (in contrast to tags, which apply to a headline, so if you have more than one block in a section, the tag will not disambiguate them). On the other hand, names are more intrusive and to some extent defeat the purpose of collapsing: they are always there whether the block is collapsed or not; tags are more discreet:
* foo :quotes:
#+name: kennedy
#+begin_quote
Do not ask what your country can do for you...
#+end_quote
#+name: lincoln
#+begin_quote
Four score and seven years ago...
#+end_quote
Which one you want to use is up to you (and "both" is also a possibility).
Use tags
From the org manual:
An excellent way to implement labels and contexts for cross-correlating information is to assign tags to headlines

Markdown metadata format

Is there a standard or convention for embedding metadata in a Markdown formatted post, such as the publication date or post author for conditional rendering by the renderer?
Looks like this Yaml metadata format might be it.
There are all kinds of strategies, e.g. an accompanying file mypost.meta.edn, but I'm hoping to keep it all in one file.
There are two common formats that look very similar but are actually different in some very specific ways. And a third which is very different.
YAML Front Matter
The Jekyll static site generator popularized YAML front matter which is deliminated by YAML section markers. Yes, the dashes are actually part of the YAML syntax. And the metadata is defined using any valid YAML syntax. Here is an example from the Jekyll docs:
---
layout: post
title: Blogging Like a Hacker
---
Note that YAML front matter is not parsed by the Markdown parser, but is removed prior to parsing by Jekyll (or whatever tool you're using) and could actually be used to request a different parser than the default Markdown parser for that page (I don't recall if Jekyll does that, but I have seen some tools which do).
MultiMarkdown Metadata
The older and simpler MultiMarkdown Metadata is actually incorporated into a few Markdown parsers. While it has more recently been updated to optionally support YAML deliminators, traditionally, the metadata ends and the Markdown document begins upon the first blank line (if the first line was blank, then no metadata). And while the syntax looks very similar to YAML, only key-value pairs are supported with no implied types. Here is an example from the MultiMarkdown docs:
Title: A Sample MultiMarkdown Document
Author: Fletcher T. Penney
Date: February 9, 2011
Comment: This is a comment intended to demonstrate
metadata that spans multiple lines, yet
is treated as a single value.
CSS: http://example.com/standard.css
The MultiMarkdown parser includes a bunch of additional options which are unique to that parser, but the key-value metadata is used across multiple parsers. Unfortunately, I have never seen any two which behaved exactly the same. Without the Markdown rules defining such a format everyone has done their own slightly different interpretation resulting in a lot of variety.
The one thing that is more common is the support for YAML deliminators and basic key-value definitions.
Pandoc Title Block
For completeness there is also the Pandoc Title Block. If has a very different syntax and is not easily confused with the other two. To my knowledge, it is only supported by Pandoc (if enabled), and it only supports three types of data: title, author, and date. Here is an example from the Pandoc documentation:
% title
% author(s) (separated by semicolons)
% date
Note that Pandoc Title Blocks are one of two style supported by Pandoc. Pandoc also supports YAML Metadata as described above.
A workaround use standard syntax and compatible with all other viewers.
I was also looking for a way to add application specific metadata to markdown files while make sure the existing viewers such as vscode and github page will ignore added metadata. Also to use extended markdown syntax is not a good idea because I want to make sure my files can be rendered correctly on different viewers.
So here is my solution: at beginning of markdown file, use following syntax to add metadata:
[_metadata_:author]:- "daveying"
[_metadata_:tags]:- "markdown metadata"
This is the standard syntax for link references, and they will not be rendered while your application can extract these data out.
The - after : is just a placeholder for url, I don't use url as value because you cannot have space in urls, but I have scenarios require array values.
Most Markdown renderers seem to support this YAML format for metadata at the top of the file:
---
layout: post
published-on: 1 January 2000
title: Blogging Like a Boss
---
Content goes here.
The most consistent form of metadata that I've found for Markdown is actually HTML meta tags, since most Markdown interpreters recognize HTML tags and will not render meta tags, meaning that metadata can be stored in a way that will not show up in rendered HTML.
<title>Hello World</title>
<meta name="description" content="The quick brown fox jumped over the lazy dog.">
<meta name="author" content="John Smith">
## Heading
Markdown content begins here
You can try this in something like GitHub Gist or StackEdit.
Correct.
Use the yaml front matter key-value syntax — like MultiMarkdown supports — but (ab)use the official markdown URL syntax to add your metadata.
… my workaround looks like this:
---
[//]: # (Title: My Awesome Title)
[//]: # (Author: Alan Smithee)
[//]: # (Date: 2018-04-27)
[//]: # (Comment: This is my awesome comment. Oh yah.)
[//]: # (Tags: #foo, #bar)
[//]: # (CSS: https://path-to-css)
---
Put this block at the top of your .md doc, with no blank line between the top of the doc and the first ---.
Your fake yaml won't be included when you render to HTML, etc. … it only appears in the .md.
You can also use this technique for adding comments in the body of a markdown doc.
This is not a standard way, but works with Markdown Extra.
I wanted something that worked in the parser, but also didn't leave any clutter when I browse the files on Bitbucket where I store the files.
So I use Abbreviations from the Markdown Extra syntax.
*[blog-date]: 2018-04-27
*[blog-tags]: foo,bar
then I parse them with regexp:
^\*\[blog-date\]:\s*(.+)\s*$
As long as I don't write the exact keywords in the text, they leave no trace. So use some prefix obscure enough to hide them.
I haven't seen this mentioned elsewhere here or in various blogs discussing the subject, but in a project for my personal website, I've decided to use a simple JSON object at the top of each markdown file to store metadata. It's a little more cumbersome to type compared to some of the more textual formats above, but it's super easy to parse. Basically I just do a regex such as ^\s*({.*?})\s*(.*)$ (with the s option on to treat . as \n) to capture the json and markdown content, then parse the json with the language's standard method. It allows pretty easily for arbitrary meta fields.

MS Word - fomat a Content Control with bullet points

I'm working with Content Controls in MS Word 2010. I add text to the Content Controls using Java. Some of the text contains several sentences and I would like to see each sentence appear as a bullet point. I've managed to define a bullet point style in MS Word. However, I don't know how to make each sentence appear as a bullet point (now the entire text appears as just one bullet point). What is the best way of going about this? I'm considering using VBA but am not sure how to add a VBA macro to a Content Control.
In Word, bullet points are implemented via list numbering.
For list numbering, you need paragraphs (you set the numPr on the pPr).
For a content control to contain paragraphs, you need a block level content control.
So, you need a block level rich text content control, then put your content in it, one paragraph per sentence, formatted using your list numbering (either directly applying the numPr, or a style which uses that numPr).

GitHub MarkDown: Are Macros and Variables possible?

I've been learning github markdown, I had a question about variables and macros.
is it possible to define a variable or macro to prevent repeated printing of a block of text?
The use case is that I have a table producing a big grid of hyperlinks - the links look like the below.
http://www.a-big-long-big-big-long-hyperlink/more-long-stuff?id=1234
it would be nice if I could do something like the below once:
$link=http://www.a-big-long-big-big-long-hyperlink/more-long-stuff?id
and then in each cell in the table, I can say something like
$link=1234
Some other cell
$link=2345
the idea being that:
The table (which has ~10 columns and ~10 rows) is a bit easier to see on a normal screen, at the moment with the prefix to the links being so long, it looks really ugly as the links wrap to the next line
If I want to change the root link, I can change it in one place (yes, I know I could do search and replace in an editor!)
Cheers.
Below are a few ways to write Reference-Links
[I'm an inline-style link](https://www.somewebsite.com)
[I'm an inline-style link with title](https://www.somewebsite.com "somewebsite's Homepage")
[I'm a reference-style link][Arbitrary case-insensitive reference text]
[I'm a relative reference to a repository file](../blob/master/LICENSE)
[You can use numbers for reference-style link definitions][1]
Or leave it empty and use the [link text itself]
Some text to show that the reference links can follow later.
[arbitrary case-insensitive reference text]: https://www.somewebsite.org
[1]: http://somewebsite.org
[link text itself]: http://www.somewebsite.com
You can use a feature of Markdown called "Reference-style links".
[link text][id] or just [link text] if link-text is unique and consist only of letters, numbers, spaces and punctuation. They are not case sensitive.
then somewhere in the document you define what id is:
[id]: http://example.com/whatever
See
https://github.com/biserkov/markdown-playground/blob/master/README.md and
https://raw.githubusercontent.com/biserkov/markdown-playground/master/README.md
GitHub Markdown (for .md files) has variables through capture:
{% capture nameOfVariableToCapture %}any markdown here...{% endcapture %}
{{ nameOfVariableToCapture }} -- that prints the content of the variable
or from {% assign variableName = "text etc." %}.
As a test, I created https://github.com/SeLite/SeLite.github.io/blob/master/MarkdownTest.md. You can see its content at http://selite.github.io/MarkdownTest (ignore the header and footer, that comes from a framework).

Only display one paragraph of text

You can set what the Facebook Share preview says. I would like it to be the first paragraph of my movable type entry. The people who make entries sometimes use
<p>
tags or they use the rich editor which puts in two
<br /><br />
tags to separate paragraphs.
Is there a way I can have movable type detect when the first paragraph end and only display the first paragraph? I would like to add that to my entry template so it will add some information to my head.
EntryBody has a lot of attributes to help format the output of the tag. You can use those to change the content so it shows up correctly in HTML, JavaScript, PHP, XML or other forms of output.
If you understand how to use regular expressions, you can use that and an additional language, say PHP, to break the body up into an array and only output the first paragraph or element of the array.
The simplest thing, though, I would think, would be to do something like
<mt:EntryBody words=100>
That will cut off the entry body after the first 100 words. You could also require users to upload an excerpt with the entry and use the entry excerpt for Facebook, instead.