<commit_before>package markup

import (
	"bytes"
	"fmt"
	"github.com/yvasiyarov/swagger/parser"
	"log"
	"os"
	"path"
	"sort"
	"strings"
)

type Markup interface {
	sectionHeader(level int, text string) string
	bulletedItem(level int, text string) string
	numberedItem(level int, text string) string
	anchor(anchorName string) string
	link(anchorName, linkText string) string
	tableHeader(tableTitle string) string
	tableHeaderRow(args ...string) string
	tableRow(args ...string) string
	tableFooter() string
}

func GenerateMarkup(parser *parser.Parser, markup Markup, outputSpec *string, defaultFileExtension string) {
	var filename string
	if *outputSpec == "" {
		filename = path.Join("./", "API", defaultFileExtension)
	} else {
		filename = path.Join(*outputSpec)
	}
	fd, err := os.Create(filename)
	if err != nil {
		log.Fatalf("Can not create document file: %v\n", err)
	}
	defer fd.Close()

	var buf bytes.Buffer

	/***************************************************************<commit_msg>remove default extension from path.Join call<commit_after>package markup

import (
	"bytes"
	"fmt"
	"github.com/yvasiyarov/swagger/parser"
	"log"
	"os"
	"path"
	"sort"
	"strings"
)

type Markup interface {
	sectionHeader(level int, text string) string
	bulletedItem(level int, text string) string
	numberedItem(level int, text string) string
	anchor(anchorName string) string
	link(anchorName, linkText string) string
	tableHeader(tableTitle string) string
	tableHeaderRow(args ...string) string
	tableRow(args ...string) string
	tableFooter() string
}

func GenerateMarkup(parser *parser.Parser, markup Markup, outputSpec *string, defaultFileExtension string) {
	var filename string
	if *outputSpec == "" {
		filename = path.Join("./", "API") + defaultFileExtension
	} else {
		filename = path.Join(*outputSpec)
	}
	fd, err := os.Create(filename)
	if err != nil {
		log.Fatalf("Can not create document file: %v\n", err)
	}
	defer fd.Close()

	var buf bytes.Buffer

	/***************************************************************
{'fraction_non_alphanumeric': 0.1748768472906404, 'fraction_numerical': 0.0, 'mean_word_length': 5.117469879518072, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7272573', 'n_tokens_mistral': 654, 'n_tokens_neox': 637, 'n_words': 177}