Site

package
v0.0.0-...-f1800c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PAGESIZE_NORMAL    = "NORMAL"
	PAGESIZE_SMALL     = "SMALL"
	PAGESIZE_VERYSMALL = "VERYSMALL"
	PAGESIZE_BIG       = "BIG"
)
View Source
const MAXTITLEIMAGESIZE int64 = 30720 //Title Image must smaller than 30KB

Variables

This section is empty.

Functions

func FileIsHtml

func FileIsHtml(filePath string) (bool, error)

func FileIsMarkdown

func FileIsMarkdown(filePath string) (bool, error)

Markdown extension .md .markdown .mmd .mdown

func IsSiteProjectEmpty

func IsSiteProjectEmpty(sp SiteProject) bool

func ResetSiteProject

func ResetSiteProject(spp *SiteProject)

Types

type HtmlPageModule

type HtmlPageModule struct {
	// contains filtered or unexported fields
}

func NewHtmlPageModule

func NewHtmlPageModule(_spp *SiteProject, _smp *SiteModule) HtmlPageModule

func (*HtmlPageModule) AddHtml

func (hpmp *HtmlPageModule) AddHtml(title, description, author, filePath, titleImagePath string, isTop bool) (bool, string, error)

func (*HtmlPageModule) Compile

func (hpmp *HtmlPageModule) Compile(ID string) (int, error)

Compile Html, just copy html from Src to Output folder, change source information and add PageOutputFile

func (*HtmlPageModule) GetHtmlFile

func (hpmp *HtmlPageModule) GetHtmlFile(ID string) string

func (*HtmlPageModule) GetHtmlInformation

func (hpmp *HtmlPageModule) GetHtmlInformation(ID string) int

func (*HtmlPageModule) GetSiteModuleP

func (hpmp *HtmlPageModule) GetSiteModuleP() *SiteModule

func (*HtmlPageModule) GetSiteProjectP

func (hpmp *HtmlPageModule) GetSiteProjectP() *SiteProject

func (*HtmlPageModule) RemoveHtml

func (hpmp *HtmlPageModule) RemoveHtml(psf Page.PageSourceFile, restore bool) (bool, error)

func (*HtmlPageModule) RestoreHtml

func (hpmp *HtmlPageModule) RestoreHtml(ID string) (bool, error)

func (*HtmlPageModule) UpdateHtml

func (hpmp *HtmlPageModule) UpdateHtml(psf Page.PageSourceFile, filePath string) (bool, error)

func (*HtmlPageModule) UpdateHtmlInformation

func (hpmp *HtmlPageModule) UpdateHtmlInformation(title, description, author, filePath, titleImagePath string) (bool, error)

type LinkModule

type LinkModule struct {
	// contains filtered or unexported fields
}

func NewLinkModule

func NewLinkModule(_spp *SiteProject) LinkModule
func (lmp *LinkModule) AddLink(title, description, author, url, titleImagePath string, isTop bool) (bool, string, error)

func (*LinkModule) Compile

func (lmp *LinkModule) Compile(ID string) (int, error)
func (lmp *LinkModule) GetLink(ID string) int

func (*LinkModule) GetSiteProjectP

func (lmp *LinkModule) GetSiteProjectP() *SiteProject

func (*LinkModule) LinkAlreadyExist

func (lmp *LinkModule) LinkAlreadyExist(linkUrl, linkTitle string) bool
func (lmp *LinkModule) RemoveLink(psf Page.PageSourceFile, restore bool) (bool, error)
func (lmp *LinkModule) RestoreLink(ID string) (bool, error)
func (lmp *LinkModule) UpdateLink(psf Page.PageSourceFile) (bool, error)

type MarkdownPageModule

type MarkdownPageModule struct {
	// contains filtered or unexported fields
}

func NewMarkdownPageModule

func NewMarkdownPageModule(_spp *SiteProject, _smp *SiteModule) MarkdownPageModule

func (*MarkdownPageModule) AddMarkdown

func (mpmp *MarkdownPageModule) AddMarkdown(title, description, author, filePath, titleImagePath string, isTop bool) (bool, string, error)

func (*MarkdownPageModule) Compile

func (mpmp *MarkdownPageModule) Compile(ID string) (int, error)

Compile Markdown, call pandoc to convert md to html to Output folder change sourceinformation and add PageOutputFile

func (*MarkdownPageModule) Compile_Psf

func (mpmp *MarkdownPageModule) Compile_Psf(psf Page.PageSourceFile) (int, error)

func (*MarkdownPageModule) CreateIndexPage

func (mpmp *MarkdownPageModule) CreateIndexPage(indexPageSize string) (bool, error)

func (*MarkdownPageModule) CreateMarkdown

func (mpmp *MarkdownPageModule) CreateMarkdown(pageFilePath, markdownType, templateFolderPath string) (bool, error)

func (*MarkdownPageModule) CreateMorePage

func (mpmp *MarkdownPageModule) CreateMorePage(indexPageSize string, startIndex, pageNo int) (bool, error)

func (*MarkdownPageModule) CreateNavigationForIndexPage

func (mpmp *MarkdownPageModule) CreateNavigationForIndexPage() (bool, error)

func (*MarkdownPageModule) CreateNavigationForMorePages

func (mpmp *MarkdownPageModule) CreateNavigationForMorePages() (bool, error)

func (*MarkdownPageModule) GetMarkdownFile

func (mpmp *MarkdownPageModule) GetMarkdownFile(ID string) string

func (*MarkdownPageModule) GetMarkdownInformation

func (mpmp *MarkdownPageModule) GetMarkdownInformation(ID string) int

func (*MarkdownPageModule) GetPageSourceTemplateFile

func (mpmp *MarkdownPageModule) GetPageSourceTemplateFile(pageType, templateFolderPath string) (string, error)

func (*MarkdownPageModule) GetSiteModuleP

func (mpmp *MarkdownPageModule) GetSiteModuleP() *SiteModule

func (*MarkdownPageModule) GetSiteProjectP

func (mpmp *MarkdownPageModule) GetSiteProjectP() *SiteProject

func (*MarkdownPageModule) RemoveMarkdown

func (mpmp *MarkdownPageModule) RemoveMarkdown(psf Page.PageSourceFile, restore bool) (bool, error)

func (*MarkdownPageModule) RestoreMarkdown

func (mpmp *MarkdownPageModule) RestoreMarkdown(ID string) (bool, error)

func (*MarkdownPageModule) UpdateMarkdown

func (mpmp *MarkdownPageModule) UpdateMarkdown(psf Page.PageSourceFile, filePath string) (bool, error)

func (*MarkdownPageModule) UpdateMarkdownInformation

func (mpmp *MarkdownPageModule) UpdateMarkdownInformation(title, description, author, filePath, titleImagePath string) (bool, error)

type SiteModule

type SiteModule struct {
	// contains filtered or unexported fields
}

func NewSiteModule

func NewSiteModule() *SiteModule

func NewSiteModule_WithArgs

func NewSiteModule_WithArgs(_projectFolderPath, _projectFileName string) *SiteModule

func (*SiteModule) AddFile

func (smp *SiteModule) AddFile(filePath string, addForce bool) (bool, error)

func (*SiteModule) AddPage

func (smp *SiteModule) AddPage(title, description, author, filePath, titleImagePath, pageType string, isTop bool) (bool, string, error)

func (*SiteModule) CleanRecycledPageSourceFiles

func (smp *SiteModule) CleanRecycledPageSourceFiles() (bool, error)

func (*SiteModule) Compile

func (smp *SiteModule) Compile(indexPageSize string) (bool, error)

func (*SiteModule) CompileNormalFile

func (smp *SiteModule) CompileNormalFile() int

func (*SiteModule) CreateMarkdown

func (smp *SiteModule) CreateMarkdown(projectFolderPath, pageFilePath, markdownType string) (bool, error)

func (*SiteModule) DeleteFile

func (smp *SiteModule) DeleteFile(filePath string) (bool, error)

func (*SiteModule) DeletePage

func (smp *SiteModule) DeletePage(pageID string, restore bool) (bool, error)

func (*SiteModule) ExportSourcePages

func (smp *SiteModule) ExportSourcePages(exportFolderPath string) (bool, error)

func (*SiteModule) FilesStatics

func (smp *SiteModule) FilesStatics() int

func (*SiteModule) GetAllPages

func (smp *SiteModule) GetAllPages() []string

func (*SiteModule) GetAllRecycledPageSourceFiles

func (smp *SiteModule) GetAllRecycledPageSourceFiles() []string

func (*SiteModule) GetOutputFilesFolderPath

func (smp *SiteModule) GetOutputFilesFolderPath(projectFolderPath string) string

func (*SiteModule) GetOutputFolderPath

func (smp *SiteModule) GetOutputFolderPath(projectFolderPath string) string

func (*SiteModule) GetOutputNormalFileList

func (smp *SiteModule) GetOutputNormalFileList() []Page.NormalFile

func (*SiteModule) GetOutputPagesFolderPath

func (smp *SiteModule) GetOutputPagesFolderPath(projectFolderPath string) string

func (*SiteModule) GetProjectFolderPath

func (smp *SiteModule) GetProjectFolderPath() string

func (*SiteModule) GetSiteInformation

func (smp *SiteModule) GetSiteInformation() (string, error)

func (*SiteModule) GetSiteProject

func (smp *SiteModule) GetSiteProject() *SiteProject

func (*SiteModule) GetSiteProjectFilePath

func (smp *SiteModule) GetSiteProjectFilePath(projectFolderPath string) (string, error)

func (*SiteModule) GetSrcFilesFolderPath

func (smp *SiteModule) GetSrcFilesFolderPath(projectFolderPath string) string

func (*SiteModule) GetSrcFolderPath

func (smp *SiteModule) GetSrcFolderPath(projectFolderPath string) string

func (*SiteModule) GetSrcHtmlFolderPath

func (smp *SiteModule) GetSrcHtmlFolderPath(projectFolderPath string) string

func (*SiteModule) GetSrcMarkdownFolderPath

func (smp *SiteModule) GetSrcMarkdownFolderPath(projectFolderPath string) string

func (*SiteModule) GetSrcNormalFileList

func (smp *SiteModule) GetSrcNormalFileList() []Page.NormalFile

func (*SiteModule) GetTemplateFolderPath

func (smp *SiteModule) GetTemplateFolderPath(projectFolderPath string) string

func (*SiteModule) InitializeSiteProjectFolder

func (smp *SiteModule) InitializeSiteProjectFolder(siteTitle, siteAuthor, siteDescription, _projectFolderPath, _outputFolderPath string) (bool, error)

func (*SiteModule) ListFile

func (smp *SiteModule) ListFile()

func (*SiteModule) OpenSiteProject

func (smp *SiteModule) OpenSiteProject(projectFolderPath, projectName string) (bool, error)

func (*SiteModule) PathIsSiteProject

func (smp *SiteModule) PathIsSiteProject(projectPath, projectName string) (bool, error)

func (*SiteModule) RestoreRecycledPageSourceFile

func (smp *SiteModule) RestoreRecycledPageSourceFile(ID string) (bool, error)

func (*SiteModule) UpdatePage

func (smp *SiteModule) UpdatePage(pageID, title, description, author, filePath, titleImagePath string, isTop bool) (bool, error)

func (*SiteModule) UpdateSiteProject

func (smp *SiteModule) UpdateSiteProject(siteFolder, siteTitle, siteAuthor, siteDescription string) (bool, error)

type SiteProject

type SiteProject struct {
	ID                 string
	Title              string
	Description        string
	Author             string
	CreateTime         string
	LastModified       string
	LastCompiled       string
	LastCompileSummary string
	OutputFolderPath   string

	SourceFiles         []Page.PageSourceFile
	OutputFiles         []Page.PageOutputFile
	IndexPageSourceFile Page.PageSourceFile
	MorePageSourceFiles []Page.PageSourceFile
}

func NewSiteProject

func NewSiteProject() *SiteProject

func NewSiteProject_WithArgs

func NewSiteProject_WithArgs(title, description, author, outputFolderPath string) *SiteProject

func (*SiteProject) AddMorePageSourceFile

func (spp *SiteProject) AddMorePageSourceFile(psf Page.PageSourceFile) (bool, error)

func (*SiteProject) AddPageOutputFile

func (spp *SiteProject) AddPageOutputFile(pof Page.PageOutputFile) (bool, error)

func (*SiteProject) AddPageSourceFile

func (spp *SiteProject) AddPageSourceFile(psf Page.PageSourceFile) (bool, error)

func (*SiteProject) BackupSiteProjectFile

func (spp *SiteProject) BackupSiteProjectFile(siteProjectFilePath string) (bool, error)

func (*SiteProject) CleanIndexPageSourceFile

func (spp *SiteProject) CleanIndexPageSourceFile() (bool, error)

func (*SiteProject) ExportSourcePages

func (spp *SiteProject) ExportSourcePages(exportFolderPath string) (bool, error)

func (*SiteProject) FromJson

func (spp *SiteProject) FromJson(_jsonString string) (bool, error)

func (*SiteProject) GetActivePageSources

func (spp *SiteProject) GetActivePageSources() []string

func (*SiteProject) GetAllPageOutputs

func (spp *SiteProject) GetAllPageOutputs() []string

func (*SiteProject) GetMorePageSourceFile

func (spp *SiteProject) GetMorePageSourceFile(ID string) int

func (*SiteProject) GetPageOutputFile

func (spp *SiteProject) GetPageOutputFile(ID string) int

func (*SiteProject) GetPageSourceFile

func (spp *SiteProject) GetPageSourceFile(ID string) int

func (*SiteProject) GetRecycledPageSources

func (spp *SiteProject) GetRecycledPageSources() []string

func (*SiteProject) GetSortedNormalOutputFiles

func (spp *SiteProject) GetSortedNormalOutputFiles() (Page.PageOutputFileSlice, error)

func (*SiteProject) GetSortedTopOutputFiles

func (spp *SiteProject) GetSortedTopOutputFiles() (Page.PageOutputFileSlice, error)

func (*SiteProject) LoadFromFile

func (spp *SiteProject) LoadFromFile(filePath string) (bool, error)

func (*SiteProject) PageStatistics

func (spp *SiteProject) PageStatistics() (string, error)

func (*SiteProject) RemoveMorePageSourceFile

func (spp *SiteProject) RemoveMorePageSourceFile(psf Page.PageSourceFile) (bool, error)

func (*SiteProject) RemovePageOutputFile

func (spp *SiteProject) RemovePageOutputFile(pof Page.PageOutputFile) (bool, error)

func (*SiteProject) RemovePageSourceFile

func (spp *SiteProject) RemovePageSourceFile(psf Page.PageSourceFile, restore bool) (bool, error)

func (*SiteProject) ResotrePageSourceFile

func (spp *SiteProject) ResotrePageSourceFile(ID string) (bool, error)

func (*SiteProject) RestoreSiteProjectFile

func (spp *SiteProject) RestoreSiteProjectFile(siteProjectFilePath string) (bool, error)

func (*SiteProject) SaveToFile

func (spp *SiteProject) SaveToFile(filePath string) (bool, error)

func (*SiteProject) SetIndexPageSourceFile

func (spp *SiteProject) SetIndexPageSourceFile(psf Page.PageSourceFile) (bool, error)

func (*SiteProject) ToJson

func (spp *SiteProject) ToJson() (string, error)

func (*SiteProject) UpdateIndexSourceFile

func (spp *SiteProject) UpdateIndexSourceFile(psf Page.PageSourceFile) (bool, error)

func (*SiteProject) UpdateMorePageSourceFile

func (spp *SiteProject) UpdateMorePageSourceFile(psf Page.PageSourceFile) (bool, error)

func (*SiteProject) UpdateMoreSourceFile

func (spp *SiteProject) UpdateMoreSourceFile(psf Page.PageSourceFile) (bool, error)

func (*SiteProject) UpdatePageOutputFile

func (spp *SiteProject) UpdatePageOutputFile(pof Page.PageOutputFile) (bool, error)

func (*SiteProject) UpdatePageSourceFile

func (spp *SiteProject) UpdatePageSourceFile(psf Page.PageSourceFile) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL