113 Commits

Author SHA1 Message Date
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
Manuel Rüger
7204ef21f6 Lint: Disable staticcheck for strings.Title
strings.Title is deprecated, but we need to keep using it since there is
no 1:1 replacement and otherwise this might change page names on
confluence.
2023-01-18 19:46:27 +01:00
Lucas Oskorep
6083ddcc88 fix: rendermode typo broke builds 2023-01-17 12:46:49 -05:00
Manuel Rüger
2f39cd80e7
Merge pull request #234 from Nr18/feat/jiraissues
feat: support ac:jiraissues macro
2023-01-16 15:23:18 +01:00
Manuel Rüger
8deecfd67a Lint 2023-01-05 11:37:42 +01:00
Noam Asor
8c02497b5f
Feature/prokod/#194 (#237)
* Initial commit (w/ debug)

* To remove debug
2023-01-04 08:54:15 +00:00
Zackery Griesinger
90d8729a7d
Fix for jira.com hosted sites (#231) 2023-01-03 17:54:30 +00:00
Manuel Rüger
3e558ac2e3
Replace deprecated io/ioutils (#230) 2023-01-03 17:54:04 +00:00
Stephan Hradek
f4bbbb19ca
Feature/themed blocks (#223)
* Allow themed blocks

* add macro code for themed blocks
2023-01-03 17:53:41 +00:00
Stephan Hradek
0b745c25e4
This should fix #171 by allowing a markdown link to start with ac: (#222) 2023-01-03 17:53:20 +00:00
Joris Conijn
5f3238b48a
feat: support ac:jiraissues macro
Add support for the `ac:jiraissues` macro. By adding the template to the stdlib. Not sure if there are other places where you need to add stuff for macros. Or how I could test this locally.
2022-12-13 11:56:27 +01:00
Egor Kovetskiy
1ebb29eba0 small style fixes related to templates 2022-10-19 20:43:40 +06:00
Manuel Rüger
78345736d5
go.mod: Update dependencies (#211)
Also switch to yaml.v3
2022-10-19 20:43:12 +06:00
Toru Kawaguchi
d276b7e78a
Correct attachment name to include path on update (#215) 2022-10-19 20:42:32 +06:00
recrtl
49c25c2c29
fix 178: update breaks on more than 50 attachments (#220) 2022-10-19 20:38:49 +06:00
Egor Kovetskiy
e1d8eccfff fix ancestry search
Signed-off-by: Egor Kovetskiy <e.kovetskiy@gmail.com>
2022-06-28 16:58:44 +06:00
Stephan Hradek
abfd01cc74
fix issue 177 (#200) 2022-06-10 10:13:22 +06:00
Stephan Hradek
39dfdec099
fix 142 redone for current master (#199) 2022-06-07 14:16:24 +06:00
Stephan Hradek
9ec7728d08
introduce inline templates (#198) 2022-06-07 10:26:15 +06:00
Stephan Hradek
3c7bd6133f
allow templates and macros to include blanks in path (#191) 2022-06-06 12:35:48 +06:00
Joel Andritsch
5ad1a4abe5
bugfix: Force pages to default width. (#175)
This change is to compensate for an API bug in Confluence where newly
create pages end up getting a random width of either "fixed" or "full".

Fixes #173
2022-04-22 15:16:46 +06:00
Philipp
f95835469c
fix: remove double collapse for codeboxes (#179)
This fixes a bug where if you used the code macro the renderer would create
an additional expand macro if the collapse option was set. This led to
the code section being collapsiable twice.

Co-authored-by: Philipp Reinke <philipp.reinke@scandio.de>
2022-04-22 15:16:04 +06:00
Dreampuf
9a4f9ff32d
Add subdirectories related templates (#158) 2022-02-02 16:02:01 +06:00
Dreampuf
2251e8ad8a
Add footnotes support (#156) 2022-02-02 16:01:38 +06:00