shithub: hugo

Download patch

ref: b05a292c218aeb1e21fc5fee2e94437b09cb977b
parent: 0f1fb8c7d8e404fc8e395fc7e8e751dfa7af8bb6
author: Bjørn Erik Pedersen <[email protected]>
date: Fri Aug 7 16:09:40 EDT 2015

Revert "Fix some Go code doc issues"

This reverts commit de7dd70bbc1ac533f137e5f788e1b337d6ba6b8c.

Broke the code fence feat.

--- a/commands/undraft.go
+++ b/commands/undraft.go
@@ -26,13 +26,13 @@
 var undraftCmd = &cobra.Command{
 	Use:   "undraft path/to/content",
 	Short: "Undraft changes the content's draft status from 'True' to 'False'",
-	Long: `Undraft changes the content's draft status from 'True' to 'False'
-and updates the date to/ the current date and time.
+	Long:  `Undraft changes the content's draft status from 'True' to 'False'
+and updates the date to the current date and time.
 If the content's draft status is 'False', nothing is done.`,
-	Run: Undraft,
+	Run:   Undraft,
 }
 
-// Undraft publishes the specified content by setting its draft status
+// Publish publishes the specified content by setting its draft status
 // to false and setting its publish date to now. If the specified content is
 // not a draft, it will log an error.
 func Undraft(cmd *cobra.Command, args []string) {
--- a/helpers/content.go
+++ b/helpers/content.go
@@ -134,7 +134,7 @@
 	return template.HTML(string(b))
 }
 
-// GetHTMLRenderer creates a new Blackfriday Renderer with the given configuration.
+// GetHtmlRenderer creates a new Renderer with the given configuration.
 func GetHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Renderer {
 	renderParameters := blackfriday.HtmlRendererParameters{
 		FootnoteAnchorPrefix:       viper.GetString("FootnoteAnchorPrefix"),
@@ -172,11 +172,12 @@
 		htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
 	}
 
-	return &hugoHtmlRenderer{
+	return &HugoHtmlRenderer{
 		blackfriday.HtmlRendererWithParameters(htmlFlags, "", "", renderParameters),
 	}
 }
 
+
 func getMarkdownExtensions(ctx *RenderingContext) int {
 	flags := 0 | blackfriday.EXTENSION_NO_INTRA_EMPHASIS |
 		blackfriday.EXTENSION_TABLES | blackfriday.EXTENSION_FENCED_CODE |
@@ -208,7 +209,7 @@
 		getMarkdownExtensions(ctx))
 }
 
-// GetMmarkHtmlRenderer creates a new MMark Renderer with the given configuration.
+// mmark
 func GetMmarkHtmlRenderer(defaultFlags int, ctx *RenderingContext) mmark.Renderer {
 	renderParameters := mmark.HtmlRendererParameters{
 		FootnoteAnchorPrefix:       viper.GetString("FootnoteAnchorPrefix"),
@@ -219,6 +220,7 @@
 
 	if b && !ctx.getConfig().PlainIDAnchors {
 		renderParameters.FootnoteAnchorPrefix = ctx.DocumentID + ":" + renderParameters.FootnoteAnchorPrefix
+		// renderParameters.HeaderIDSuffix = ":" + ctx.DocumentId
 	}
 
 	htmlFlags := defaultFlags
--- a/helpers/content_renderer.go
+++ b/helpers/content_renderer.go
@@ -8,12 +8,12 @@
 	"github.com/spf13/viper"
 )
 
-// hugoHtmlRenderer wraps a blackfriday.Renderer, typically a blackfriday.Html
-type hugoHtmlRenderer struct {
+// Wraps a blackfriday.Renderer, typically a blackfriday.Html
+type HugoHtmlRenderer struct {
 	blackfriday.Renderer
 }
 
-func (renderer *hugoHtmlRenderer) blockCode(out *bytes.Buffer, text []byte, lang string) {
+func (renderer *HugoHtmlRenderer) BlockCode(out *bytes.Buffer, text []byte, lang string) {
 	if viper.GetBool("PygmentsCodeFences") {
 		str := html.UnescapeString(string(text))
 		out.WriteString(Highlight(str, lang, ""))
--- a/helpers/path.go
+++ b/helpers/path.go
@@ -85,7 +85,6 @@
 	return strings.ToLower(MakePath(s))
 }
 
-// MakeTitle trims any space and replaces hypens with a single space.
 func MakeTitle(inpath string) string {
 	return strings.Replace(strings.TrimSpace(inpath), "-", " ", -1)
 }