Esempio n. 1
0
        private void BuildParameters(MarkdownBuilder mb, List <TypeScriptParameter> parameters)
        {
            if (parameters.Count > 0)
            {
                mb.Header(4, "Parameters:");

                foreach (var param in parameters)
                {
                    var paramInfo = ParameterInfo(param);
                    if (param.Comment != null)
                    {
                        if (!string.IsNullOrEmpty(param.Comment.ShortText))
                        {
                            paramInfo += " - " + param.Comment.ShortText;
                        }
                        else if (!string.IsNullOrEmpty(param.Comment.Text))
                        {
                            paramInfo += " - " + param.Comment.Text;
                        }
                    }

                    mb.List(paramInfo);
                }

                mb.AppendLine();
            }
        }
Esempio n. 2
0
        private void WriteCommitWithType(MarkdownBuilder mb, ProjectSettings project, CommitWithType commit, string prefix)
        {
            var message = commit.Source.Message.Replace($"[{commit.Type}] ", "",
                                                        StringComparison.InvariantCultureIgnoreCase);
            var    separator   = message.IndexOf("\n");
            var    title       = message;
            string description = null;

            if (separator >= 0)
            {
                title       = message.Substring(0, separator);
                description = message.Substring(separator + 1);
            }

            mb.List(project.LogItemTemplate
                    .Replace("${ItemType}", prefix)
                    .Replace("${ItemTitle}", title)
                    .Replace("${ItemDescription}", description));
        }