You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Xlog is a Go package that has its public API documented and published on https://pkg.go.dev as all Go packages do. Latest documentation can be found here https://pkg.go.dev/github.com/emad-elsaid/xlog
1
+
Xlog is a Go package that has its public API documented and published on https://pkg.go.dev as all Go packages do. Latest documentation can be found here https://pkg.go.dev/github.com/emad-elsaid/xlog/v2
Copy file name to clipboardExpand all lines: docs/Generate static website.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,8 @@ xlog --build /path/to/output
8
8
9
9
Xlog will build all markdown files to HTML and extract all static files from inside the binary executable file to that destination directory. Then it will terminate.
10
10
11
-
Building process creates a xlog server instance and request all pages and save it to desk. That allow xlog extensions to define a new handler that renders a page. the page will work in both usecases: local server, static site generation. extensions has to also register the path for build using [`RegisteBuildPage`](https://pkg.go.dev/github.com/emad-elsaid/xlog#RegisterBuildPage) function
11
+
Building process creates a xlog server instance and request all pages and save it to desk. That allow xlog extensions to define a new handler that renders a page. the page will work in both usecases: local server, static site generation. extensions has to also register the path for build using [`RegisteBuildPage`](https://pkg.go.dev/github.com/emad-elsaid/xlog/v2#RegisterBuildPage) function
12
12
13
13
While building static site xlog turns on **READONLY** mode. so specifying `--build` flag is equal to `--build --readonly`.
14
14
15
-
Xlog builds `/docs` directory every commit to update this website. it uses Github workflow to do that. https://github.com/emad-elsaid/xlog/blob/master/.github/workflows/xlog.yml
15
+
Xlog builds `/docs` directory every commit to update this website. it uses Github workflow to do that. https://github.com/emad-elsaid/xlog/v2/blob/master/.github/workflows/xlog.yml
Xlog is distributed as Go package that has a CLI that uses the package and all `xlog/extensions`. documentation of the Go package API can be found on https://pkg.go.dev/github.com/emad-elsaid/xlog
1
+
Xlog is distributed as Go package that has a CLI that uses the package and all `xlog/extensions`. documentation of the Go package API can be found on https://pkg.go.dev/github.com/emad-elsaid/xlog/v2
Copy file name to clipboardExpand all lines: docs/Hello world extension.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ First create an empty directory and initialize a new go module in it
18
18
mkdir helloworld
19
19
cd helloworld
20
20
go mod init github.com/emad-elsaid/helloworld
21
-
go get github.com/emad-elsaid/xlog
21
+
go get github.com/emad-elsaid/xlog/v2
22
22
```
23
23
24
24
Replace the URL to your github account or any other URL where your extension will be hosted. as per Go modules convention.
@@ -40,7 +40,7 @@ package main
40
40
41
41
import (
42
42
// Core
43
-
"github.com/emad-elsaid/xlog"
43
+
"github.com/emad-elsaid/xlog/v2"
44
44
45
45
// Extensions
46
46
_ "github.com/emad-elsaid/helloworld"
@@ -101,7 +101,7 @@ Packages add features to Xlog by calling `Register*` functions in the `init` fun
101
101
102
102
For our extension we want to add "Hello world!" before the actual page content. this is exactly what the Preprocessor is for. a function that processes the page text before rendering it to HTML.
103
103
104
-
We will create a function that implement the [Preprocessor interface](https://pkg.go.dev/github.com/emad-elsaid/xlog#Preprocessor). `helloworld.go` should have the following content.
104
+
We will create a function that implement the [Preprocessor interface](https://pkg.go.dev/github.com/emad-elsaid/xlog/v2#Preprocessor). `helloworld.go` should have the following content.
105
105
106
106
```go
107
107
package helloworld
@@ -117,12 +117,12 @@ This is a function that takes the page content as string and return the content
117
117
118
118
Now we'll need to register this function as a preprocessor.
119
119
1. We create a struct that imports `xlog.Extension`
120
-
1. We'll do this by importing xlog core and use [`RegisterPreprocessor`](https://pkg.go.dev/github.com/emad-elsaid/xlog#RegisterPreprocessor) in the Extension `Init`.
120
+
1. We'll do this by importing xlog core and use [`RegisterPreprocessor`](https://pkg.go.dev/github.com/emad-elsaid/xlog/v2#RegisterPreprocessor) in the Extension `Init`.
Copy file name to clipboardExpand all lines: docs/helper.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,4 +2,4 @@ A helper function is a function that is used in an html template. the output of
2
2
3
3
Helper functions are Go `html/template` concept it's not introduced by xlog. an example can be found in html/template [documentation](https://pkg.go.dev/html/template#example-Template-Helpers).
4
4
5
-
Extensions can define their own helpers to be used by any template using [`RegisterHelper`](https://pkg.go.dev/github.com/emad-elsaid/xlog#RegisterHelper) function. Registering a new helper has to be in the extension `init` function to be find at the time of parsing the templates.
5
+
Extensions can define their own helpers to be used by any template using [`RegisterHelper`](https://pkg.go.dev/github.com/emad-elsaid/xlog/v2#RegisterHelper) function. Registering a new helper has to be in the extension `init` function to be find at the time of parsing the templates.
0 commit comments