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 article about syntax highlight with Pygments #51
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for this @Ze0nC, and fantastic that you built a plugin for Pygments! I left a few comments inline, mainly I'd like this new document to be somewhat simplified, to make it easier for me to maintain. Let me know if you want any additional info.
It is a Pygments plugin for [Publish](https://github.com/johnsundell/publish) to highlight code. | ||
[Pygments](https://pygments.org) is a syntax highlighting tool made in Python that supports many languages. | ||
|
||
## Requirements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than putting instructions inline here, I'd prefer for this and the following "How to" section to simply reference your plugin's README. Otherwise, I'll have to make sure to keep this up to date as you change your implementation and requirements, which'll most likely result in this becoming out of date. Take a look at the Splash plugin's "How to" guide for example. I think this file should only contain step number 4, that is, how to insert your plugin into a publishing pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have moved the detailed guide to plugin's README.md and simplified the How-to ariticle.
```swift | ||
import SwiftPygmentsPublishPlugin | ||
... | ||
try DeliciousRecipes().publish(using: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a more generic website name here, like MyWebsite
, since DeliciousRecipes
only makes sense within the context of the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I will change it.
Documentation/README.md
Outdated
@@ -11,5 +11,6 @@ Shorter articles focused on explaining how to get a given task done using Publis | |||
- [Adding Swift syntax highlighting to Markdown code blocks](HowTo/adding-swift-syntax-highlighting.md) | |||
- [Nesting items within folders](HowTo/nested-items.md) | |||
- [Using a custom `DateFormatter`](HowTo/using-a-custom-date-formatter.md) | |||
- [Add syntax highlighting with Pygments](HowTo/add-syntax-highlighting-with-pygments.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be "Adding" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Change has been made.
Details are moved to plugin's readme.md
I have made some change to the articles. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Ze0nC, it looks great now. Just a few grammar fixes + suggestions. Let me know if you don't have time to fix these and I can fix them post-merge, and let me know if I can provide any additional context.
@@ -0,0 +1,21 @@ | |||
# How to add syntax highlighting with Pygments | |||
[Splash](https://github.com/JohnSundell/Splash) and its [official plugin](https://github.com/JohnSundell/SplashPublishPlugin) are great tools for highlighting swift syntax in Publish. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"swift" -> "Swift"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"in Publish" -> "when using Publish"
# How to add syntax highlighting with Pygments | ||
[Splash](https://github.com/JohnSundell/Splash) and its [official plugin](https://github.com/JohnSundell/SplashPublishPlugin) are great tools for highlighting swift syntax in Publish. | ||
|
||
However, some people write not only in Swift, but also in many other languages. There comes the [SwiftPygmentsPublishPlugin](https://github.com/Ze0nC/SwiftPygmentsPublishPlugin) to help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: "There comes the ... to help" -> "That's when ... can be really useful"
|
||
However, some people write not only in Swift, but also in many other languages. There comes the [SwiftPygmentsPublishPlugin](https://github.com/Ze0nC/SwiftPygmentsPublishPlugin) to help. | ||
|
||
Please follow the plugin's [installation guide](https://github.com/Ze0nC/SwiftPygmentsPublishPlugin#installation) to install pygments and add it to your website's Swift package, and then add it to publishing pipeline: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"pygments" -> "Pygments"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"and add it" -> "and to add it"
"to publishing pipeline" -> "to your publishing pipeline"
]) | ||
``` | ||
|
||
Please refer to [usage guide](https://github.com/Ze0nC/SwiftPygmentsPublishPlugin#usage) to see how to specify syntax language and more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"refer to [" -> "refer to the ["
|
||
Please refer to [usage guide](https://github.com/Ze0nC/SwiftPygmentsPublishPlugin#usage) to see how to specify syntax language and more. | ||
|
||
Note that you will need to add css for `Pygments` to actually see the highlighted code. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"css" -> "CSS".
Also if you're going to use Pygments
here (stylized as code) then I recommend stylizing all other mentions of Pygments similarly.
Hi. I have fixed the grammar and now looks much better. Btw I made another plugin to make tags have different colors. I will share it later. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks so much @Ze0nC! Looking forward to seeing more plugins 🎉
Hi. Thank you for making Publish.
I have made a plugin for syntax highlighting using Pygments, and added a How-to article about using the plugin.
I hope it will help a little bit to the project.
Here is an example on my site built with Publish:
https://czj.pw/highlight
Cheers,
Zhijin