Skip to content

Commit

Permalink
publish html to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sunfmin committed Nov 11, 2021
1 parent 5ef3967 commit 50c9c9c
Show file tree
Hide file tree
Showing 21 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions dev.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DIR=$(PWD)
snippetgo -pkg=docs > ./docs/examples-generated.go
snippetgo -pkg=docsrc > ./docsrc/examples-generated.go

cd $(PWD)/docs
cd $(PWD)/docsrc
go run ./build/main.go

function docsRestart() {
Expand Down
14 changes: 0 additions & 14 deletions docs/build/main.go

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions docs/dist/index.html → docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h2>Getting Started</h2>
</p>

<bran-code language='go'>
<template slot='sourcecode'>package docs
<template slot='sourcecode'>package docsrc

import (
. &#34;github.com/theplant/docgo&#34;
Expand Down Expand Up @@ -86,8 +86,8 @@ <h2>Getting Started</h2>
}
fmt.Println(&#34;Starting docs at :&#34; + port)
http.Handle(&#34;/&#34;, docgo.New().
Assets(&#34;/assets/&#34;, docs.Assets).
Home(docs.Home).
Assets(&#34;/assets/&#34;, docsrc.Assets).
Home(docsrc.Home).
Build(),
)
err := http.ListenAndServe(&#34;:&#34;+port, nil)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes
14 changes: 14 additions & 0 deletions docsrc/build/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package main

import (
"github.com/theplant/docgo"
"github.com/theplant/docgo/docsrc"
)

func main() {
docgo.New().
Assets("/assets/", docsrc.Assets).
Home(docsrc.Home).
SitePrefix("/docgo/").
BuildStaticSite("../docs")
}
6 changes: 3 additions & 3 deletions docs/docsmain/main.go → docsrc/docsmain/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"

"github.com/theplant/docgo"
"github.com/theplant/docgo/docs"
"github.com/theplant/docgo/docsrc"
)

// @snippet_begin(BootUpDevSample)
Expand All @@ -17,8 +17,8 @@ func main() {
}
fmt.Println("Starting docs at :" + port)
http.Handle("/", docgo.New().
Assets("/assets/", docs.Assets).
Home(docs.Home).
Assets("/assets/", docsrc.Assets).
Home(docsrc.Home).
Build(),
)
err := http.ListenAndServe(":"+port, nil)
Expand Down
6 changes: 3 additions & 3 deletions docs/examples-generated.go → docsrc/examples-generated.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/hello-world.go → docsrc/hello-world.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @snippet_begin(HelloWorldSample)
package docs
package docsrc

import (
. "github.com/theplant/docgo"
Expand Down
2 changes: 1 addition & 1 deletion docs/home.go → docsrc/home.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package docs
package docsrc

import (
"embed"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package docs
package docsrc

import (
. "github.com/theplant/docgo"
Expand Down
2 changes: 1 addition & 1 deletion docs/use-with-htmlgo.go → docsrc/use-with-htmlgo.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package docs
package docsrc

import (
. "github.com/theplant/docgo"
Expand Down
4 changes: 2 additions & 2 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import (
"testing"

. "github.com/theplant/docgo"
"github.com/theplant/docgo/docs"
"github.com/theplant/docgo/docsrc"
h "github.com/theplant/htmlgo"
"github.com/theplant/testingutils"
)

func TestAll(t *testing.T) {
var s = New().
Home(docs.Home).
Home(docsrc.Home).
Header(h.Div()).
Footer(h.Div()).
Build()
Expand Down

0 comments on commit 50c9c9c

Please sign in to comment.