{% import "fmt" %} {% import "github.com/bouncepaw/mycorrhiza/cfg" %} HyphaeLinksHTML returns a comma-separated list of hyphae that were affected by this revision as HTML string. {% func (rev Revision) HyphaeLinksHTML() %} {% stripspace %} {% for i, hyphaName := range rev.hyphaeAffected() %} {% if i > 0 %} {% endif %} {%s hyphaName %} {% endfor %} {% endstripspace %} {% endfunc %} HyphaeDiffsHTML returns a comma-separated list of diffs links of current revision for every affected file as HTML string. {% func (rev Revision) HyphaeDiffsHTML() %} {% code entries := rev.hyphaeAffected() %} {% stripspace %} {% if len(entries) == 1 %} {%s rev.Hash %} {% else %} {% for i, hyphaName := range entries %} {% if i > 0 %} {% endif %} {% if i == 0 %} {%s rev.Hash %}  {% endif %} {%s hyphaName %} {% endfor %} {% endif %} {% endstripspace %} {% endfunc %} descriptionForFeed generates a good enough HTML contents for a web feed. {% func (rev *Revision) descriptionForFeed() %}

{%s rev.Message %} (by {%s rev.Username %} at {%s rev.TimeString() %})

Hyphae affected: {%= rev.HyphaeLinksHTML() %}

{%s rev.textDiff() %}
{% endfunc %} WithRevisions returns an html representation of `revs` that is meant to be inserted in a history page. {% func WithRevisions(hyphaName string, revs []Revision) %} {% for _, grp := range groupRevisionsByMonth(revs) %} {% code currentYear := grp[0].Time.Year() currentMonth := grp[0].Time.Month() sectionId := fmt.Sprintf("%04d-%02d", currentYear, currentMonth) %}

{%d currentYear %} {%s currentMonth.String() %}

{% endfor %} {% endfunc %} {% func (rev *Revision) asHistoryEntry(hyphaName string) %}
  • {%s rev.Hash %} {%s rev.Message %} {% if rev.Username != "anon" %} by {% endif %}
  • {% endfunc %}