Example: Improving text in links to GitHub repos #47
claremacrae
started this conversation in
Example Patterns
Replies: 1 comment
-
|
To develop this, I set up a test markdown file with a load of links with problem cases in for this: - [GitHub - Dmitriy-Shulha/obsidian-css-snippets: Most common appearance solutions for Obsidian now in a single place. Initially collected by Klaas: https://forum.obsidian.md/t/how-to-achieve-css-code-snippets/8474](https://github.com/Dmitriy-Shulha/obsidian-css-snippets)
- [GitHub - UserName/sample-repo-name: Sample:,_()- Description](https://github.com/UserName/sample-repo-name)
- [GitHub - arnemertz/commandline-videostore-cpp: C++ port of https://github.com/rickjanda/commandline-videostore](https://github.com/arnemertz/commandline-videostore-cpp)
- [GitHub - chubin/cheat.sh: the only cheat sheet you need](https://github.com/chubin/cheat.sh)
- [GitHub - copperspice/doxypress](https://github.com/copperspice/doxypress)
- [GitHub - maskiran/lightroom_collection_tree: Mirror the collection/collection sets in Lightroom onto the file system](https://github.com/maskiran/lightroom_collection_tree)
- [UserName/sample-repo-name: Sample:,_()- Description](https://github.com/UserName/sample-repo-name)
- [pimoroni/flotilla-rockpool: The Flotilla web dashboard](https://github.com/pimoroni/flotilla-rockpool/)
- [GitHub - approvals/ApprovalTests.Python: ApprovalTests for python](https://github.com/approvals/ApprovalTests.Python)Which looks like this in Reading mode: When I apply the above pattern to the whole file, the result is this: - [Dmitriy-Shulha/**obsidian-css-snippets**](https://github.com/Dmitriy-Shulha/obsidian-css-snippets): Most common appearance solutions for Obsidian now in a single place. Initially collected by Klaas: https://forum.obsidian.md/t/how-to-achieve-css-code-snippets/8474
- [UserName/**sample-repo-name**](https://github.com/UserName/sample-repo-name): Sample:,_()- Description
- [arnemertz/**commandline-videostore-cpp**](https://github.com/arnemertz/commandline-videostore-cpp): C++ port of https://github.com/rickjanda/commandline-videostore
- [chubin/**cheat.sh**](https://github.com/chubin/cheat.sh): the only cheat sheet you need
- [copperspice/**doxypress**](https://github.com/copperspice/doxypress)
- [maskiran/**lightroom_collection_tree**](https://github.com/maskiran/lightroom_collection_tree): Mirror the collection/collection sets in Lightroom onto the file system
- [UserName/**sample-repo-name**](https://github.com/UserName/sample-repo-name): Sample:,_()- Description
- [pimoroni/**flotilla-rockpool**](https://github.com/pimoroni/flotilla-rockpool): The Flotilla web dashboard
- [approvals/**ApprovalTests.Python**](https://github.com/approvals/ApprovalTests.Python): ApprovalTests for python(Aside: see #29 for how the test file made bug-reporting easier) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Uh oh!
There was an error while loading. Please reload this page.
-
Lots of my notes contain links to GitHub repos, and I use the Auto Link Title plugin to fetch the repo's title.
So for example, pasting in
https://github.com/jglev/obsidian-apply-patterns-pluginresults in:... which displays as:
I find that quite hard to read, and I would like the repo name to stand out better.
I used to manually format these to display like this instead:
Then Apply Patterns came along, and now I use that to apply the format I want:
[ { "name": "Format GithHub Repo Link", "rules": [ { "from": "\\[(GitHub - ){0,1}([A-Za-z-\\d)]+)\\/([A-Za-z\\d\\-_.]+)(: [^\\]]+){0,1}\\]\\(https:\\/\\/github.com\\/([A-Za-z-\\d)]+)\\/([A-Za-z\\d\\-_.]+)\\/?\\)", "to": "[$2/**$3**](https://github.com/$2/$3)$4", "caseInsensitive": false, "global": true, "multiline": false, "sticky": false, "disabled": false } ], "collapsed": false, "cursorRegexStart": "^", "cursorRegexEnd": "$", "done": false } ]Beta Was this translation helpful? Give feedback.
All reactions