Skip to content

Commit

Permalink
showOnlyFirstParagraph
Browse files Browse the repository at this point in the history
  • Loading branch information
majimaccho committed Oct 26, 2023
1 parent 730b29d commit 693d890
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion output/md/md.go
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ func (m *Md) makeTableTemplateData(t *schema.Table) map[string]interface{} {
number := m.config.Format.Number
adjust := m.config.Format.Adjust
hideColumns := m.config.Format.HideColumnsWithoutValues
showOnlyFirstParagraph := m.config.Format.ShowOnlyFirstParagraph

// Columns
columnsData := [][]string{}
Expand Down Expand Up @@ -603,9 +604,13 @@ func (m *Md) makeTableTemplateData(t *schema.Table) map[string]interface{} {
}

for _, v := range t.Viewpoints {
desc := v.Desc
if showOnlyFirstParagraph {
desc = output.ShowOnlyFirstParagraph(desc)
}
data := []string{
fmt.Sprintf("[%s](viewpoint-%d.md)", v.Name, v.Index),
v.Desc,
desc,
}

viewpointsData = append(viewpointsData, data)
Expand Down
2 changes: 1 addition & 1 deletion testdata/md_test_a.md.first_para.golden
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ TABLE A
| Name | Definition |
| ---- | ---------- |
| [table a b](viewpoint-0.md) | select table a and b |
| [table a label red](viewpoint-3.md) | select table a and label red<br><br>- table a<br>- label red |
| [table a label red](viewpoint-3.md) | select table a and label red |

## Constraints

Expand Down

0 comments on commit 693d890

Please sign in to comment.