Exemple #1
0
        private static string GetShortList_Line(KeywordDescription x)
        {
            string codeExample;
            string extras;

            if (x.Key == @"tag")
            {
                codeExample = "#[i]tag[/i]";
                extras      = null;
            }
            else
            {
                switch (x.Type)
                {
                case KeywordType.Child:
                    codeExample = $"{x.Key}([i]{GetReadableType(x.Type).ToSentenceMember()}[/i])";
                    break;

                case KeywordType.Child | KeywordType.String:
                    codeExample = $"{x.Key}: [i]{GetReadableType(x.Type).ToSentenceMember()}[/i]";
                    break;

                case KeywordType.Flag:
                    codeExample = $"{x.Key}+";
                    break;

                default:
                    codeExample = $"{x.Key}: [i]{GetReadableType(x.Type).ToSentenceMember()}[/i]";
                    break;
                }

                var altKeys = x.AlternativeKeys.Count(y => y.Length < x.Key.Length) > 0
                        ? $"shortcut: {x.AlternativeKeys.Where(y => y.Length < x.Key.Length).Select(y => $"[mono][b]{y}[/b][/mono]").First()}"
                        : null;
                var units = x.Unit != null ? $"in {x.Unit} by default" : null;
                extras = new[] { units, altKeys }.JoinToString(@", ");
                if (extras.Length > 0)
                {
                    extras = $" ({extras})";
                }
            }

            return($" • [mono][b]{codeExample}[/b][/mono] – {x.Description.ToSentenceMember()}{extras};");
        }
Exemple #2
0
 private static string GetShortList_Line(KeywordDescription x)
 {
     return($" • [mono][b]{x.Key}[/b][/mono]: {x.Description.ToSentenceMember()} ({x.Type.GetReadableType().ToSentenceMember()}" +
            (x.AlternativeKeys.Length > 0 ? $", alternative keys: {x.AlternativeKeys.Select(y => $"[mono][b]{y}[/b][/mono]").JoinToReadableString()}" : "") + ");");
 }