-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a command line option that reduces attachment filenames to thei… #185
base: master
Are you sure you want to change the base?
Added a command line option that reduces attachment filenames to thei… #185
Conversation
…r basename only instead of containing the whole local path as a prefix, which can be ugly especially if the local path uses upwards directory movement resulting in something like ".._.._.._dir_Attachment.txt" instead of "Attachment.txt". The command line option is opt-in, which means this addition does not break anything.
Hi! What is your motivation behind making this behavior optional? It feels like we've got a bunch of command line arguments already. |
There are two related reasons for why I made it optional: First, to consider that some users might rely on the old behavior and changing the default would be a breaking change (I did not want to pull the rug from anyone's feet) and, If you think it's okay in this case to sacrifice feature/behavior stability in favor of keeping down the number of command line arguments, I could of course also make it the new behavior and scrap the old one entirely, but I did not want to make this call by myself. |
Why not make it also a configurable option in the That way one can make it a default by means of the configuration file. And maybe instead of having it be a boolean you could make it an integer:
|
commit 3f19088 Merge: 7e73eab 765ca72 Author: Optimierungswerfer <[email protected]> Date: Tue Aug 29 14:16:06 2023 +0200 Merge branch 'attachment-basename' commit 7e73eab Author: Optimierungswerfer <[email protected]> Date: Tue Aug 29 14:14:31 2023 +0200 Added exe to gitignore commit 2e6559a Author: Optimierungswerfer <[email protected]> Date: Tue Aug 29 12:05:50 2023 +0200 Remove merge artifacts commit 8832e0d Merge: daeba54 b426d5c Author: Optimierungswerfer <[email protected]> Date: Tue Aug 29 12:01:46 2023 +0200 Merge branch 'master' of https://github.com/Optimierungswerfer/mark commit b426d5c Author: Manuel Rüger <[email protected]> Date: Wed Aug 9 13:06:31 2023 +0200 Define parent pages from CLI commit 8b72bc8 Author: Manuel Rüger <[email protected]> Date: Wed Aug 9 15:38:48 2023 +0200 Add pagetreesearch macro commit 4c81bbe Author: Manuel Rüger <[email protected]> Date: Mon Jul 31 09:59:18 2023 +0200 Bump to 9.7.1 commit 3c7512b Author: Manuel Rüger <[email protected]> Date: Mon Jul 31 09:58:21 2023 +0200 Bump dependencies commit d147aac Author: Manuel Rüger <[email protected]> Date: Wed Jul 5 17:40:55 2023 +0200 .goreleaser: Update deprecated syntax commit cbe0b05 Author: Manuel Rüger <[email protected]> Date: Wed Jul 5 17:33:33 2023 +0200 Bump version to 9.7.0 commit bf16d55 Author: Manuel Rüger <[email protected]> Date: Wed Jul 5 17:28:59 2023 +0200 Add recently-updated macro commit ac982f3 Author: Manuel Rüger <[email protected]> Date: Wed Jul 5 15:24:18 2023 +0200 Add panel macro commit 179700f Author: Manuel Rüger <[email protected]> Date: Mon Jul 3 15:33:19 2023 +0200 .github: Reorder steps to use module caching commit e18b30b Author: gmarraff <[email protected]> Date: Mon Jul 3 15:22:42 2023 +0200 doc: clarify links usage of page title with spaces The word space can be misleading in this context since it can be confused as 'Confluence Space'. commit bc5c7ae Author: Manuel Rüger <[email protected]> Date: Wed Jun 21 18:40:12 2023 +0200 Bump to v9.6.2 commit 494ddce Author: Manuel Rüger <[email protected]> Date: Wed Jun 21 18:39:56 2023 +0200 go.mod: Update dependencies commit 9fb9d89 Author: Manuel Rüger <[email protected]> Date: Wed Jun 14 15:57:31 2023 +0200 Bump version to 9.6.1 commit 4591586 Author: Manuel Rüger <[email protected]> Date: Wed Jun 14 15:39:28 2023 +0200 Disable typographer extension This caused issues with confluence macros commit 857bc87 Author: Manuel Rüger <[email protected]> Date: Wed Jun 14 15:52:42 2023 +0200 Fix flaky mermaid png test Only check for the header as bytes might changed depending on system png library commit d07e8ec Author: Manuel Rüger <[email protected]> Date: Thu Jun 8 22:54:15 2023 +0200 Bump version to 9.6.0 commit bec6d38 Author: Ryan Kitchen <[email protected]> Date: Thu Jun 8 09:43:11 2023 -0700 Update README.md Co-authored-by: Manuel Rüger <[email protected]> commit 383e4ae Author: Ryan Kitchen <[email protected]> Date: Thu Jun 8 09:42:44 2023 -0700 Update pkg/mark/stdlib/stdlib.go Co-authored-by: Manuel Rüger <[email protected]> commit e41572c Author: Ryan <[email protected]> Date: Wed Jun 7 16:36:30 2023 -0700 readme commit d8109c6 Author: Ryan <[email protected]> Date: Wed Jun 7 16:28:53 2023 -0700 readme commit 063b6e7 Author: Ryan <[email protected]> Date: Wed Jun 7 16:04:05 2023 -0700 page-tree commit 22bf460 Author: Manuel Rüger <[email protected]> Date: Mon Jun 5 22:51:13 2023 +0200 Fix user mentioning commit 278488e Author: Manuel Rüger <[email protected]> Date: Fri May 26 11:07:24 2023 +0200 Update mermaid to v10.2.0 commit 80d3be2 Author: Zackery Griesinger <[email protected]> Date: Wed May 3 13:16:36 2023 -0500 Add Jira Filter View Macro commit 0988a7a Author: Manuel Rüger <[email protected]> Date: Wed May 24 19:31:08 2023 +0200 Add Page properties macro commit 28ee195 Author: Manuel Rüger <[email protected]> Date: Wed May 24 19:23:40 2023 +0200 Add Page Properties Report macro commit 3307f32 Author: Manuel Rüger <[email protected]> Date: Wed May 24 19:11:12 2023 +0200 Add contentbylabel macro commit dbb5237 Author: Manuel Rüger <[email protected]> Date: Tue May 23 12:36:16 2023 +0200 Bump version to 9.5.2 commit 0b6dd09 Author: Manuel Rüger <[email protected]> Date: Tue May 23 12:25:03 2023 +0200 Drop newlines completely from macros commit dbadf47 Author: Manuel Rüger <[email protected]> Date: Tue May 23 11:53:43 2023 +0200 Bump version to 9.5.1 commit 9a37fc4 Author: Manuel Rüger <[email protected]> Date: Tue May 23 11:08:38 2023 +0200 Drop newlines within macros Newlines will cause trouble when rendering and the macro is used inside a table. commit 6d8d70a Author: Manuel Rüger <[email protected]> Date: Tue May 23 08:43:06 2023 +0200 Version bump to 9.5.0 commit cb5e4aa Author: Manuel Rüger <[email protected]> Date: Mon May 22 21:09:35 2023 +0200 Bump dependencies commit 6a63913 Author: Manuel Rüger <[email protected]> Date: Mon May 22 20:50:26 2023 +0200 Add user profile macro commit d67cc63 Author: Manuel Rüger <[email protected]> Date: Mon May 22 20:49:50 2023 +0200 Fallback to old user search commit 0828171 Author: Manuel Rüger <[email protected]> Date: Mon May 22 17:22:32 2023 +0200 Add expand macro commit 484f988 Author: Manuel Rüger <[email protected]> Date: Fri May 19 18:47:55 2023 +0200 Move drop-h1 to the renderer This is more reliable than a regular expression. commit 5602297 Author: Ryan Kitchen <[email protected]> Date: Fri May 12 10:05:04 2023 -0700 Update README.md updated per mrueg suggestions commit 679eb7f Author: Ryan Kitchen <[email protected]> Date: Wed May 10 15:45:32 2023 -0700 Update README.md tiny changes, big impact commit f0bb706 Author: Ryan Kitchen <[email protected]> Date: Wed May 10 09:55:42 2023 -0700 Update README.md Co-authored-by: Manuel Rüger <[email protected]> commit ae5163d Author: Ryan Kitchen <[email protected]> Date: Wed May 10 09:48:57 2023 -0700 Update README.md commit 3271218 Author: Manuel Rüger <[email protected]> Date: Fri May 5 14:52:52 2023 +0200 Bump version to 9.4.0 commit 2aa1606 Author: Manuel Rüger <[email protected]> Date: Fri May 5 14:43:36 2023 +0200 Fix usage of strings.ReplaceAll commit eba2396 Author: Rémi Courtel <[email protected]> Date: Fri May 5 12:40:23 2023 +0200 fix 305: external images URLs are not properly escaped commit 622be6e Author: Manuel Rüger <[email protected]> Date: Thu May 4 14:53:33 2023 +0200 Support customizable layouts commit 21d0a7d Author: Manuel Rüger <[email protected]> Date: Wed May 3 21:32:42 2023 +0200 Bump version to 9.3.1 commit 13c5949 Author: Manuel Rüger <[email protected]> Date: Wed May 3 21:26:16 2023 +0200 Fix mermaid-go rendering commit af221d5 Author: Manuel Rüger <[email protected]> Date: Wed May 3 18:55:25 2023 +0200 .goreleaser.yml: Support arm64 builds commit 72cfc04 Author: Manuel Rüger <[email protected]> Date: Wed May 3 18:47:50 2023 +0200 Bump version to 9.3.0 commit fd97ee7 Author: Manuel Rüger <[email protected]> Date: Wed Apr 26 08:02:35 2023 +0200 Support inline images commit 2b756da Author: Manuel Rüger <[email protected]> Date: Wed May 3 15:59:18 2023 +0200 Add debug output for config commit 51accf0 Author: Manuel Rüger <[email protected]> Date: Wed Apr 26 12:15:14 2023 +0200 Bump version to 9.2.1 commit 73f2693 Author: Manuel Rüger <[email protected]> Date: Wed Apr 26 12:11:22 2023 +0200 Dockerfile: Use dumb-init and overwrite entrypoint commit abd0c8b Author: Manuel Rüger <[email protected]> Date: Wed Apr 26 08:03:04 2023 +0200 Bump version to 9.2.0 commit d9d560e Author: Dreampuf <[email protected]> Date: Wed Apr 12 13:43:34 2023 +0200 Add support for mermaid via library Implementation is largely based on: kovetskiy#167 Co-Authored-By: Manuel Rueger <[email protected]> commit 88c070f Author: Manuel Rüger <[email protected]> Date: Tue Apr 25 22:55:06 2023 +0200 Add issue templates commit 4c3d417 Author: Manuel Rüger <[email protected]> Date: Tue Apr 25 22:45:15 2023 +0200 Ignore error if default config file does not exist commit 2f44bcb Author: Manuel Rüger <[email protected]> Date: Thu Apr 20 12:43:08 2023 +0200 Make config backwards-compatible commit 262853f Author: Manuel Rüger <[email protected]> Date: Tue Apr 18 15:06:16 2023 +0200 Simplify config handling * Switch to urfave/cli/v2 * Add more environment variables commit d1f69bc Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 14:20:06 2023 +0200 Bump version to 9.1.4 commit 2773e15 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 14:19:32 2023 +0200 .github: Quote go version commit 1c1f82a Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 14:02:33 2023 +0200 Bump version to 9.1.3 commit 2e52ae8 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 14:02:16 2023 +0200 .github: Fix goreleaser build commit c6d01eb Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:51:40 2023 +0200 Bump version to 9.1.2 commit f75924b Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:51:13 2023 +0200 .github: Fix tag commit 20afbc5 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:35:19 2023 +0200 Bump version to 9.1.1 commit 768b470 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:35:05 2023 +0200 .github: Fix release workflow commit 657d4f5 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:32:51 2023 +0200 Bump version to 9.1.0 commit 1b6ab89 Merge: 7969bcb 429bbf9 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:32:20 2023 +0200 Merge pull request kovetskiy#279 from mrueg/build-fixes go 1.20 / docker image push automation commit 429bbf9 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:25:26 2023 +0200 Push Docker image on tag commit 7969bcb Merge: a29feb1 9bb9f45 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:30:10 2023 +0200 Merge pull request kovetskiy#278 from mrueg/add-anchor feat: Support anchor macro commit eade059 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:12:56 2023 +0200 Update to go 1.20 commit 9bb9f45 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 13:05:35 2023 +0200 feat: Support anchor macro commit a29feb1 Merge: 943a356 deb7cd9 Author: Manuel Rüger <[email protected]> Date: Mon Apr 3 10:23:00 2023 +0200 Merge pull request kovetskiy#277 from mrueg/support-ac-include feat: Support page include, excerpt and excerpt-include macro commit deb7cd9 Author: Manuel Rüger <[email protected]> Date: Fri Mar 31 17:25:33 2023 +0200 feat: Add Excerpt and ExcerptInclude macros commit 1285947 Author: Manuel Rüger <[email protected]> Date: Fri Mar 31 16:25:54 2023 +0200 feat: Support page inclusion macro Also generalize the ac_tag_parser a bit and support <ri:* /> tags as well commit 943a356 Author: Manuel Rüger <[email protected]> Date: Fri Mar 31 11:40:29 2023 +0200 Bump version to 9.0.3 commit 8193f2d Merge: e7e61ba 80d9064 Author: Manuel Rüger <[email protected]> Date: Fri Mar 31 11:35:42 2023 +0200 Merge pull request kovetskiy#273 from bernd/fix/issue-272 Implement a custom parser for `<ac:*/>` tags commit 80d9064 Author: Bernd Ahlers <[email protected]> Date: Fri Mar 31 11:09:58 2023 +0200 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. commit 6e4a912 Author: Bernd Ahlers <[email protected]> Date: Fri Mar 31 10:51:50 2023 +0200 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. commit e7e61ba Author: Manuel Rüger <[email protected]> Date: Thu Mar 30 15:02:05 2023 +0200 Bump version to 9.0.2 commit a60dd52 Merge: 98e15ed 974de93 Author: Manuel Rüger <[email protected]> Date: Thu Mar 30 15:01:03 2023 +0200 Merge pull request kovetskiy#270 from bernd/fix/ac-tag-escaping Fix "<ac:*>" tag rendering commit 974de93 Author: Bernd Ahlers <[email protected]> Date: Thu Mar 30 14:34:19 2023 +0200 Rename variable commit 238ae29 Author: Bernd Ahlers <[email protected]> Date: Thu Mar 30 14:30:15 2023 +0200 Fix "<ac:*>" tag rendering Extend the existing workaround to avoid HTML element escaping to handle more variants. commit 98e15ed Author: Manuel Rüger <[email protected]> Date: Wed Mar 29 15:57:13 2023 +0200 Bump version to 9.0.1 commit fca934f Merge: fef6692 6265c7f Author: Manuel Rüger <[email protected]> Date: Wed Mar 29 15:56:23 2023 +0200 Merge pull request kovetskiy#268 from mrueg/fix-codeblock Render codeblocks properly commit 6265c7f Author: Manuel Rüger <[email protected]> Date: Wed Mar 29 15:31:13 2023 +0200 Render CodeBlocks properly commit fef6692 Author: Manuel Rüger <[email protected]> Date: Wed Mar 29 11:00:56 2023 +0200 Bump version to 9.0 commit 93218f1 Merge: 3dd6d0a a3dc8be Author: Manuel Rüger <[email protected]> Date: Tue Mar 28 16:54:04 2023 +0200 Merge pull request kovetskiy#260 from mrueg/switch-to-goldmark Replace blackfriday with goldmark commit a3dc8be Author: Manuel Rüger <[email protected]> Date: Mon Mar 6 16:23:06 2023 +0100 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. commit 3dd6d0a Author: Manuel Rüger <[email protected]> Date: Mon Mar 27 20:16:21 2023 +0200 Bump version to 8.10 commit 700cbc1 Merge: d00d94a 30b0785 Author: Manuel Rüger <[email protected]> Date: Thu Mar 23 08:01:46 2023 +0100 Merge pull request kovetskiy#265 from lucasoskorep/fix/relative-links Fix: Relative links extractmetadata files for filetypes other than markdown. commit 30b0785 Author: Lucas Oskorep <[email protected]> Date: Wed Mar 22 19:10:19 2023 -0400 feat: moving to IsTextFile for file type detection commit 67c9b24 Author: Lucas Oskorep <[email protected]> Date: Wed Mar 22 15:11:49 2023 -0400 fix: extract metadata fails for file types which are not .md commit d00d94a Author: Manuel Rüger <[email protected]> Date: Tue Mar 21 11:09:47 2023 +0100 Bump to version 8.9 commit 530ff5c Merge: eab5655 9840c01 Author: Manuel Rüger <[email protected]> Date: Tue Mar 21 11:07:59 2023 +0100 Merge pull request kovetskiy#262 from mrueg/fix-relative-links fix: Support relative links with titleFromH1 commit 9840c01 Author: Manuel Rüger <[email protected]> Date: Mon Mar 20 22:54:11 2023 +0100 Include space parameter as well commit 21cf51e Author: Manuel Rüger <[email protected]> Date: Mon Mar 20 19:56:02 2023 +0100 Clean up logic a bit commit 20d3d1f Author: Manuel Rüger <[email protected]> Date: Mon Mar 20 19:19:31 2023 +0100 fix: Support relative links with titleFromH1 commit eab5655 Merge: 4b5e9c2 9e656ec Author: Manuel Rüger <[email protected]> Date: Mon Mar 6 15:00:18 2023 +0100 Merge pull request kovetskiy#258 from bernd/add/content-appearance-option Add Content-Appearance header commit 9e656ec Author: Bernd Ahlers <[email protected]> Date: Mon Mar 6 10:09:28 2023 +0100 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". commit 4b5e9c2 Merge: cea0510 c0bc7dc Author: Manuel Rüger <[email protected]> Date: Tue Feb 21 15:25:34 2023 +0100 Merge pull request kovetskiy#256 from mrueg/bump-8.8 Bump version to 8.8 commit c0bc7dc Author: Manuel Rüger <[email protected]> Date: Tue Feb 21 14:56:37 2023 +0100 Bump version to 8.8 commit cea0510 Merge: e754bf1 2a9f830 Author: Manuel Rüger <[email protected]> Date: Tue Feb 21 14:49:22 2023 +0100 Merge pull request kovetskiy#255 from mrueg/build-image Build image commit 2a9f830 Author: Manuel Rüger <[email protected]> Date: Tue Feb 14 15:08:11 2023 +0100 .github: Add build image step commit ca2dbe5 Author: Manuel Rüger <[email protected]> Date: Tue Feb 14 15:08:01 2023 +0100 Dockerfile: Freeze builder image versions commit e754bf1 Merge: fb8e589 df3e95f Author: Manuel Rüger <[email protected]> Date: Mon Feb 13 15:50:17 2023 +0100 Merge pull request kovetskiy#250 from Fethbita/master ac:image macro commit df3e95f Merge: 24aa73e fb8e589 Author: Fethbita <[email protected]> Date: Mon Feb 13 16:46:45 2023 +0200 Merge branch 'kovetskiy:master' into master commit 24aa73e Author: Fethbita <[email protected]> Date: Mon Feb 13 16:46:06 2023 +0200 Add width keyword for html comment commit fb8e589 Merge: 20ba4dd 738400c Author: Manuel Rüger <[email protected]> Date: Tue Feb 7 15:43:48 2023 +0100 Merge pull request kovetskiy#252 from mrueg/add-blog-posts-macro Add blog-posts macro commit 20ba4dd Merge: b82e18f 4d16a1f Author: Manuel Rüger <[email protected]> Date: Tue Feb 7 13:50:12 2023 +0100 Merge pull request kovetskiy#251 from jay-stillman/issue/173 bugfix: Remove forced default width, forced full-width commit 738400c Author: Manuel Rüger <[email protected]> Date: Mon Feb 6 18:16:39 2023 +0100 Add blog-posts macro commit 4d16a1f Author: Jay Stillman <[email protected]> Date: Mon Feb 6 01:18:34 2023 -0500 bugfix: Remove forced default width, forced full-width without editor config kovetskiy#175 commit e0222ae Author: Fethbita <[email protected]> Date: Sat Feb 4 15:20:21 2023 +0200 Add ac:image width and edited README.md commit 8debc23 Author: Sylvain Malnuit <[email protected]> Date: Tue Sep 28 15:00:13 2021 +0200 ac:image commit b82e18f Merge: cd08a70 ce9573a Author: Manuel Rüger <[email protected]> Date: Tue Jan 31 14:18:48 2023 +0100 Merge pull request kovetskiy#248 from prokod/bugfix/prokod/kovetskiy#247 To add fallback to blockquote when type is none commit ce9573a Author: Noam Asor <[email protected]> Date: Sat Jan 28 21:15:31 2023 +0100 To add fallack to blockquote when type is none commit cd08a70 Author: Manuel Rüger <[email protected]> Date: Fri Jan 27 11:39:27 2023 +0100 .github: Build with go 1.19 commit d09ee6e Author: Manuel Rüger <[email protected]> Date: Fri Jan 27 11:38:15 2023 +0100 Bump version to 8.7 commit adee018 Merge: 8a1bd88 1b3c7b4 Author: Manuel Rüger <[email protected]> Date: Fri Jan 27 11:37:00 2023 +0100 Merge pull request kovetskiy#244 from xiu/fix/214 fix: Title not being extracted when not on the first line commit 1b3c7b4 Author: Guillaume Hérail <[email protected]> Date: Wed Jan 25 13:08:08 2023 +0100 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 <[email protected]> commit 8a1bd88 Merge: 5ff8daf fb8213b Author: Manuel Rüger <[email protected]> Date: Thu Jan 26 10:44:42 2023 +0100 Merge pull request kovetskiy#246 from mrueg/bump-deps go.mod: Update dependencies commit fb8213b Author: Manuel Rüger <[email protected]> Date: Thu Jan 26 09:49:40 2023 +0100 go.mod: Update dependencies commit 667e7be Author: Guillaume Hérail <[email protected]> Date: Wed Jan 25 10:52:00 2023 +0100 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 kovetskiy#214 commit 5ff8daf Merge: 1a4ae1a 7204ef2 Author: Manuel Rüger <[email protected]> Date: Thu Jan 19 11:35:06 2023 +0100 Merge pull request kovetskiy#243 from mrueg/fix-lint Lint: Disable staticcheck for strings.Title commit 7204ef2 Author: Manuel Rüger <[email protected]> Date: Wed Jan 18 19:46:25 2023 +0100 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. commit 1a4ae1a Merge: 2f39cd8 6083ddc Author: Manuel Rüger <[email protected]> Date: Wed Jan 18 19:31:02 2023 +0100 Merge pull request kovetskiy#242 from lucasoskorep/master fix: rendermode typo broke builds commit 6083ddc Author: Lucas Oskorep <[email protected]> Date: Tue Jan 17 12:46:49 2023 -0500 fix: rendermode typo broke builds commit 2f39cd8 Merge: abc9120 5f3238b Author: Manuel Rüger <[email protected]> Date: Mon Jan 16 15:23:18 2023 +0100 Merge pull request kovetskiy#234 from Nr18/feat/jiraissues feat: support ac:jiraissues macro commit abc9120 Author: Manuel Rüger <[email protected]> Date: Fri Jan 6 18:34:49 2023 +0100 .github: Move CI into the right folder (kovetskiy#239) commit 4ef1d47 Merge: 7eb7ccc 8deecfd Author: Manuel Rüger <[email protected]> Date: Thu Jan 5 23:05:36 2023 +0100 Merge pull request kovetskiy#238 from mrueg/ci Add a CI pipeline that runs on PRs commit 8deecfd Author: Manuel Rüger <[email protected]> Date: Thu Jan 5 11:30:22 2023 +0100 Lint commit bde4b70 Author: Manuel Rüger <[email protected]> Date: Thu Jan 5 11:26:32 2023 +0100 .github: Add CI pipeline commit 721dd1b Author: Manuel Rüger <[email protected]> Date: Thu Jan 5 11:25:14 2023 +0100 Makefile: Add test target commit 7eb7ccc Author: Egor Kovetskiy <[email protected]> Date: Wed Jan 4 09:09:37 2023 +0000 no funding needed Signed-off-by: Egor Kovetskiy <[email protected]> commit 843089a Author: Egor Kovetskiy <[email protected]> Date: Wed Jan 4 09:00:03 2023 +0000 all-contributors: generate thank you list Signed-off-by: Egor Kovetskiy <[email protected]> commit ab54070 Author: Egor Kovetskiy <[email protected]> Date: Wed Jan 4 08:59:03 2023 +0000 bump version Signed-off-by: Egor Kovetskiy <[email protected]> commit 8c02497 Author: Noam Asor <[email protected]> Date: Wed Jan 4 09:54:15 2023 +0100 Feature/prokod/kovetskiy#194 (kovetskiy#237) * Initial commit (w/ debug) * To remove debug commit 5920dbf Author: Egor Kovetskiy <[email protected]> Date: Tue Jan 3 17:58:28 2023 +0000 bump version Signed-off-by: Egor Kovetskiy <[email protected]> commit 90d8729 Author: Zackery Griesinger <[email protected]> Date: Tue Jan 3 11:54:30 2023 -0600 Fix for jira.com hosted sites (kovetskiy#231) commit 3e558ac Author: Manuel Rüger <[email protected]> Date: Tue Jan 3 18:54:04 2023 +0100 Replace deprecated io/ioutils (kovetskiy#230) commit f4bbbb1 Author: Stephan Hradek <[email protected]> Date: Tue Jan 3 18:53:41 2023 +0100 Feature/themed blocks (kovetskiy#223) * Allow themed blocks * add macro code for themed blocks commit 0b745c2 Author: Stephan Hradek <[email protected]> Date: Tue Jan 3 18:53:20 2023 +0100 This should fix kovetskiy#171 by allowing a markdown link to start with ac: (kovetskiy#222) commit 55b58bd Author: Manuel Rüger <[email protected]> Date: Tue Jan 3 18:52:48 2023 +0100 Allow Title via h1 without any other metadata (kovetskiy#229) commit 5f3238b Author: Joris Conijn <[email protected]> Date: Tue Dec 13 11:56:27 2022 +0100 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. commit ef71aa1 Author: Egor Kovetskiy <[email protected]> Date: Wed Oct 19 20:44:04 2022 +0600 bump version Signed-off-by: Egor Kovetskiy <[email protected]> commit 1ebb29e Author: Egor Kovetskiy <[email protected]> Date: Tue Jun 7 14:21:11 2022 +0600 small style fixes related to templates commit 7834573 Author: Manuel Rüger <[email protected]> Date: Wed Oct 19 16:43:12 2022 +0200 go.mod: Update dependencies (kovetskiy#211) Also switch to yaml.v3 commit d276b7e Author: Toru Kawaguchi <[email protected]> Date: Wed Oct 19 23:42:32 2022 +0900 Correct attachment name to include path on update (kovetskiy#215) commit 49c25c2 Author: recrtl <[email protected]> Date: Wed Oct 19 16:38:49 2022 +0200 fix 178: update breaks on more than 50 attachments (kovetskiy#220) commit daeba54 Author: Optimierungswerfer <[email protected]> Date: Wed Jun 29 09:27:34 2022 +0200 Revert "Merge pull request #1 from Optimierungswerfer/attachment-replacements" This reverts commit a320579, reversing changes made to e1d8ecc. commit 1186acd Merge: a320579 bed97f1 Author: Optimierungswerfer <[email protected]> Date: Wed Jun 29 09:02:17 2022 +0200 Merge pull request #2 from Optimierungswerfer/attachment-basename Added a command line option that reduces attachment filenames to thei… commit a320579 Merge: e1d8ecc 9ad6a3f Author: Optimierungswerfer <[email protected]> Date: Wed Jun 29 09:01:42 2022 +0200 Merge pull request #1 from Optimierungswerfer/attachment-replacements Fix kovetskiy#184 commit 9ad6a3f Author: Optimierungswerfer <[email protected]> Date: Mon May 9 18:30:49 2022 +0200 Fix kovetskiy#184
For just one commandline parameter there are quite a lot of changes. And what about my suggestion of making it an integer giving the number of elements you want to keep from the filename? |
…r basename only instead of containing the whole local path as a prefix, which can be ugly especially if the local path uses upwards directory movement resulting in something like "......_dir_Attachment.txt" instead of "Attachment.txt". The command line option is opt-in, which means this addition does not break anything.