mirror of
https://github.com/documize/community.git
synced 2025-07-23 23:29:42 +02:00
WIP
This commit is contained in:
parent
f916801008
commit
689e5078b8
1 changed files with 16 additions and 18 deletions
|
@ -45,16 +45,12 @@ func BuildExport(ctx domain.RequestContext, s domain.Store, spec exportSpec) (ht
|
||||||
switch spec.FilterType {
|
switch spec.FilterType {
|
||||||
case "space":
|
case "space":
|
||||||
|
|
||||||
content := strings.Builder{}
|
|
||||||
|
|
||||||
for _, spaceID := range spec.Data {
|
for _, spaceID := range spec.Data {
|
||||||
t, c, e := exportSpace(ctx, s, spaceID)
|
t, c, e := exportSpace(ctx, s, spaceID)
|
||||||
if e != nil {
|
if e == nil {
|
||||||
return "", err
|
content.WriteString(c)
|
||||||
|
toc = append(toc, t...)
|
||||||
}
|
}
|
||||||
|
|
||||||
content.WriteString(c)
|
|
||||||
toc = append(toc, t...)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case "category":
|
case "category":
|
||||||
|
@ -181,14 +177,14 @@ func exportDocument(ctx domain.RequestContext, s domain.Store, documentID string
|
||||||
page.Numberize(p)
|
page.Numberize(p)
|
||||||
|
|
||||||
// Put out document name.
|
// Put out document name.
|
||||||
b.WriteString("<div class='doc-header'")
|
b.WriteString(fmt.Sprintf("<div class='export-doc-header' id='%s'>", doc.RefID))
|
||||||
b.WriteString("<div class='doc-title'")
|
b.WriteString("<div class='export-doc-title'>")
|
||||||
b.WriteString(doc.Title)
|
b.WriteString(doc.Title)
|
||||||
b.WriteString("</div")
|
b.WriteString("</div>")
|
||||||
b.WriteString("<div class='doc-excerpt'")
|
b.WriteString("<div class='export-doc-excerpt'>")
|
||||||
b.WriteString(doc.Excerpt)
|
b.WriteString(doc.Excerpt)
|
||||||
b.WriteString("</div")
|
b.WriteString("</div>")
|
||||||
b.WriteString("</div")
|
b.WriteString("</div>")
|
||||||
|
|
||||||
// Construct HMTL.
|
// Construct HMTL.
|
||||||
for _, page := range p {
|
for _, page := range p {
|
||||||
|
@ -246,25 +242,27 @@ const (
|
||||||
.export-toc .export-toc-entry:hover {
|
.export-toc .export-toc-entry:hover {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
.doc-header {
|
.export-doc-header {
|
||||||
padding: 20px 30px;
|
padding: 20px 30px;
|
||||||
margin: 10px 0;
|
margin: 70px 0 30px 0;
|
||||||
background-color: #F7F2FF;
|
background-color: #F7F2FF;
|
||||||
border: 2px solid #280A42;
|
border: 2px solid #280A42;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
}
|
}
|
||||||
.doc-header .doc-title {
|
.export-doc-title {
|
||||||
color: #280A42;
|
color: #280A42;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
font-weight; bold;
|
font-weight; bold;
|
||||||
margin: 0 0 5px 0;
|
margin: 0 0 5px 0;
|
||||||
}
|
}
|
||||||
.doc-header .doc-excerpt {
|
.export-doc-excerpt {
|
||||||
color: #280A42;
|
color: #280A42;
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
font-weight; normal;
|
font-weight; normal;
|
||||||
}
|
}
|
||||||
|
.document-structure {
|
||||||
|
margin: 20px 0 !important;
|
||||||
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
// Styles copied from minified production CSS assets.
|
// Styles copied from minified production CSS assets.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue