Skip to content
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

Fix source code highlighting #96

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import org.asciidoctor.gradle.jvm.AsciidoctorTask

def attrs = [
'sourcedir' : '../examples/',
'source-highlighter': 'rouge',
'source-highlighter': 'rouge', // todo: fix CSS in PDF
'epub3-stylesdir' : './styles/epub',
// NOTE don't include leading ./ because it messes up paths in the epub files
'imagesdir' : 'images',
Expand Down Expand Up @@ -88,6 +88,7 @@ task pdf(type: AsciidoctorTask, description: 'Generates PDF for download') {

task epub(type: AsciidoctorTask, description: 'Generates EPUB3') {
attributes attrs + ['source-highlighter': 'coderay']
// todo: fix EPUB to highlight TS and shell code
outputDir "$buildDir/asciidoc/epub3"
outputOptions {
backends 'epub3'
Expand Down
2 changes: 1 addition & 1 deletion src/docs/asciidoc/modules/ROOT/pages/preface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class BlogController {

When we want to draw your attention to certain lines of code, those lines are annotated using numbers accompanied by brief descriptions.

[source,ts]
[source,typescript]
----
export class SearchComponent {
constructor(private searchService: SearchService) {} <1>
Expand Down