136 Commits

Author SHA1 Message Date
Manuel Rüger
b426d5c6b1 Define parent pages from CLI 2023-08-10 08:02:38 +02:00
Manuel Rüger
8b72bc8e20 Add pagetreesearch macro 2023-08-09 15:43:06 +02:00
Manuel Rüger
bf16d55d68 Add recently-updated macro 2023-07-05 17:32:55 +02:00
Manuel Rüger
ac982f3077 Add panel macro 2023-07-05 15:48:11 +02:00
Manuel Rüger
4591586b01 Disable typographer extension
This caused issues with confluence macros
2023-06-14 15:56:40 +02:00
Manuel Rüger
857bc871e0 Fix flaky mermaid png test
Only check for the header as bytes might changed depending on system png
library
2023-06-14 15:54:53 +02:00
Ryan Kitchen
383e4ae2d0 Update pkg/mark/stdlib/stdlib.go
Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2023-06-08 22:52:46 +02:00
Ryan
063b6e7e1b page-tree 2023-06-08 22:52:46 +02:00
Manuel Rüger
22bf46026b Fix user mentioning 2023-06-08 22:49:15 +02:00
Manuel Rüger
278488ed88 Update mermaid to v10.2.0 2023-05-26 11:26:44 +02:00
Zackery Griesinger
80d3be268d Add Jira Filter View Macro 2023-05-25 18:05:31 +02:00
Manuel Rüger
0988a7aba1 Add Page properties macro 2023-05-25 07:21:10 +02:00
Manuel Rüger
28ee195a77 Add Page Properties Report macro 2023-05-25 07:21:10 +02:00
Manuel Rüger
3307f329d9 Add contentbylabel macro 2023-05-25 07:21:10 +02:00
Manuel Rüger
0b6dd09013 Drop newlines completely from macros 2023-05-23 12:30:46 +02:00
Manuel Rüger
9a37fc4713 Drop newlines within macros
Newlines will cause trouble when rendering and the macro is used inside
a table.
2023-05-23 11:49:04 +02:00
Manuel Rüger
6a63913a1e Add user profile macro 2023-05-23 07:33:11 +02:00
Manuel Rüger
d67cc63871 Fallback to old user search 2023-05-23 07:33:11 +02:00
Manuel Rüger
08281712cc Add expand macro 2023-05-23 07:33:11 +02:00
Manuel Rüger
484f988f32 Move drop-h1 to the renderer
This is more reliable than a regular expression.
2023-05-22 07:55:04 +02:00
Manuel Rüger
2aa1606d11 Fix usage of strings.ReplaceAll 2023-05-05 14:51:51 +02:00
Rémi Courtel
eba2396010 fix 305: external images URLs are not properly escaped 2023-05-05 14:41:59 +02:00
Manuel Rüger
622be6e25f Support customizable layouts 2023-05-05 10:52:04 +02:00
Manuel Rüger
13c594981e Fix mermaid-go rendering 2023-05-03 21:31:45 +02:00
Manuel Rüger
fd97ee70f9 Support inline images 2023-05-03 18:47:20 +02:00
Dreampuf
d9d560eda0 Add support for mermaid via library
Implementation is largely based on: https://github.com/kovetskiy/mark/pull/167

Co-Authored-By: Manuel Rueger <manuel@rueg.eu>
2023-04-25 23:59:17 +02:00
Manuel Rüger
262853f6c0 Simplify config handling
* Switch to urfave/cli/v2
* Add more environment variables
2023-04-20 14:34:55 +02:00
Manuel Rüger
9bb9f45326 feat: Support anchor macro 2023-04-03 13:11:35 +02:00
Manuel Rüger
deb7cd9cbc feat: Add Excerpt and ExcerptInclude macros 2023-03-31 17:35:18 +02:00
Manuel Rüger
1285947ab3 feat: Support page inclusion macro
Also generalize the ac_tag_parser a bit and support <ri:* /> tags as
well
2023-03-31 16:47:24 +02:00
Bernd Ahlers
80d906417c
Fix custom link renderer and add tests for Confluence links
Since we now have a custom parser for <ac:*/> tags, the custom link
renderer added an additional </a> tag at the end of each internal
Confluence link.

Add tests for internal links and add an example for internal links with
spaces in page titles to the README file.
2023-03-31 11:09:58 +02:00
Bernd Ahlers
6e4a912b11
Implement a custom parser for <ac:*/> tags
This replaces the workaround to replace colons in <ac:*/> tags with a
magic string with a custom parser for these tags to parse them as
ast.KindRawHtml.

The custom parser is a stripped down version of goldmark's rawHTMLParser.
2023-03-31 10:51:50 +02:00
Bernd Ahlers
974de93ef1
Rename variable 2023-03-30 14:34:19 +02:00
Bernd Ahlers
238ae29b59
Fix "<ac:*>" tag rendering
Extend the existing workaround to avoid HTML element escaping to handle
more variants.
2023-03-30 14:30:15 +02:00
Manuel Rüger
6265c7ff81 Render CodeBlocks properly 2023-03-29 15:45:11 +02:00
Manuel Rüger
a3dc8bed05 Replace blackfriday with goldmark
This change replaces the unmaintained blackfriday markdown renderer with the
goldmark renderer.
The goal is to have wider support for more markdown extensions and ideally
have a better solution for mermaid transformation via extensions as well.
2023-03-27 20:36:43 +02:00
Lucas Oskorep
30b0785fae feat: moving to IsTextFile for file type detection 2023-03-22 19:14:34 -04:00
Lucas Oskorep
67c9b248dd fix: extract metadata fails for file types which are not .md 2023-03-22 15:45:14 -04:00
Manuel Rüger
9840c01e8a Include space parameter as well 2023-03-20 22:54:11 +01:00
Manuel Rüger
20d3d1f05c fix: Support relative links with titleFromH1 2023-03-20 19:43:01 +01:00
Bernd Ahlers
9e656ece15
Add Content-Appearance header
Allows switching between the "full-width" and "fixed" page layouts.

The "fixed" layout renders the page in a narrow column. (Confluence
default)

If not configured, it defaults to "full-width".
2023-03-06 10:09:28 +01:00
Fethbita
df3e95f5fd
Merge branch 'kovetskiy:master' into master 2023-02-13 16:46:45 +02:00
Manuel Rüger
fb8e589bc4
Merge pull request #252 from mrueg/add-blog-posts-macro
Add blog-posts macro
2023-02-07 15:43:48 +01:00
Manuel Rüger
738400c292 Add blog-posts macro 2023-02-06 18:16:39 +01:00
Jay Stillman
4d16a1f606 bugfix: Remove forced default width, forced full-width without editor config #175 2023-02-06 01:18:34 -05:00
Fethbita
e0222ae6bd
Add ac:image width and edited README.md 2023-02-04 15:20:21 +02:00
Sylvain Malnuit
8debc23476
ac:image 2023-02-04 15:15:47 +02:00
Noam Asor
ce9573a86e To add fallack to blockquote when type is none 2023-01-28 21:15:31 +01:00
Guillaume Hérail
1b3c7b4127 fix: Properly handle macro when extracting Metadata
When a macro is set in the header, only the first line will be read and then
discarded. This makes sure we keep the macro in and stop processing metadata
when we hit a macro.

Co-authored-by: Manuel Rüger <manuel@rueg.eu>
2023-01-26 17:01:47 +01:00
Guillaume Hérail
667e7be221 fix: Title not being extracted when not on the first line
While a page with a macro is processed, having a macro leaves an unclean buffer
for further processing steps, including title extraction.  The problem seems to
come from `ExtractMeta`: as it runs through the metadata, it hits the first
line of the macro but since it doesn't look like a complete Metadata (e.g.
matching either `\[\]:\s*#\s*\(([^:]+):\s*(.*)\)` or
`<!--\s*([^:]+):\s*(.*)\s*-->` in
https://github.com/kovetskiy/mark/blob/master/pkg/mark/meta.go#L37:L38, it will
break the loop in
https://github.com/kovetskiy/mark/blob/master/pkg/mark/meta.go#L61 and return
the final document as:
```
  Template: ac:children
  Style: h2
  Excerpt: none
  Page:
  TestSpace:Test
  Reverse: false
  All: true -->

:children:
```

This then goes into `ExtractDocumentLeadingH1` which doesn't find a match for
the regex `^#[^#]\s*(.*)\s*\n`, returning an empty title since the title is not
on the first line. This commit, while it doesn't fix the unclean document,
fixes the regex to properly find the title.

Closes #214
2023-01-25 11:51:56 +01:00