Closed daveaglick closed 5 years ago
I absolutely believe in the verb-noun format. State (1) what you do, and (2) the thing you do it to.
I whole-heartedly endorse this plan.
I'll think it is a good idea. Especially If
could makes problems in Visual Studio's if
-snippet. SetContent
is also easier to understand what it does then Content
. đź‘Ť
This looks like a great idea. You have my blessing. đź‘Ť
“Clean code is simple and direct. Clean code reads like well-written prose. Clean code never obscures the designer’s intent but rather is full of crisp abstractions and straightforward lines of control.
- Grady Booch author of Object Oriented Analysis and Design with Applications”
Here's a mapping of existing module names to new ones for reference (I'll edit this comment as I figure out what the new names should be):
Append
-> AppendContent
AutoLink
-> InsertLinks
Branch
, Concat
, ConcatBranch
, Merge
-> ExecuteModules
Combine
-> CombineDocuments
Content
-> ReplaceContent
CopyMeta
-> CopyMetadata
CsvToHtml
-> RenderCsvAsHtml
CsvToMarkdown
-> RenderCsvAsMarkdown
DirectoryMeta
-> ApplyDirectoryMetadata
Documents
-> ReplaceDocuments
Download
-> ReadWeb
ExcelToCsv
-> ConvertExcelToCsv
Excerpt
-> GenerateExcerpt
ExecuteContext
ExecuteDocument
FileName
-> OptimizeFileName
Flatten
-> FlattenTree
ForEach
-> ForEachDocument
FrontMatter
-> ExtractFrontMatter
GenerateCloudSearchData
GenerateFeeds
GenerateJson
GitHub
-> ReadGitHub
GroupBy
, GroupByMany
-> GroupDocuments
Headings
-> GatherHeadings
Highlight
-> HighlightCode
HtmlEscape
-> EscapeHtml
HtmlInsert
-> InsertHtml
HtmlQuery
-> QueryHtml
If
-> ExecuteIf
Image
-> MutateImage
Include
-> ProcessIncludes
Index
-> AddIndexes
Join
-> JoinDocuments
Json
-> ParseJson
Less
-> CompileLess
Markdown
-> RenderMarkdown
Merge
-> MergeDocuments
, MergeMetadata
Meta
-> AddMetadata
MinifyCss
MinifyHtml
MinifyJs
MinifyXhtml
MinifyXml
MirrorResources
OrderBy
, Sort
-> OrderDocuments
Paginate
-> PaginateDocuments
Prepend
-> PrependContent
Razor
-> RenderRazor
ReadApplicationInput
ReadDataModule<TModule, TItem>
ReadFiles
ReadProject
ReadSolution
ReadWorkspace
Redirect
-> GenerateRedirects
Replace
-> ReplaceContent
ReplaceIn
-> ReplaceWithContent
Sass
-> CompileSass
SearchIndex
-> GenerateLunrIndex
SetDestination
Shortcodes
-> ProcessShortcodes
Sidecar
-> ProcessSidecarFile
Sitemap
-> GenerateSitemap
Sql
-> ReadSql
Switch
-> ExecuteSwitch
Take
-> TakeDocuments
Title
-> AddTitle
Trace
-> TraceMessage
Tree
-> CreateTree
ValidateLinks
ValidateMeta<T>
Where
-> FilterDocuments
WriteFiles
Xml
-> ReadXml
Xmp
-> ReadXmp
Xslt
-> TransformXslt
Yaml
-> ParseYaml
YouTube
-> ReadYouTube
Since tons of other stuff is breaking in v3, I've started looking at other stuff that's been bothering me but that I'd normally just leave alone. This may be the one final opportunity to correct some of these nits.
One area I think could be improved is module names. It made sense for them to be as short as possible when we were scripting config files (at least that was the thinking), but since it'll be code-based with Intellisense in v3, maybe it's time to rethink that.
I'm considering going through modules and renaming them so they all follow the pattern [verb][noun]:
Append
->AppendContent
AutoLink
->InsertLinks
Content
->SetContent
Replace
->ReplaceContent
Markdown
->RenderMarkdown
Redirect
->GenerateRedirects
Shortcodes
->ProcessShortcodes
Branch
->ExecuteBranch
Concat
->ConcatDocuments
GroupBy
->GroupDocuments
If
->ExecuteIf
You get the idea. I'll generate a table we can point to that shows the old and new names for people porting custom configs.
Thoughts? cc @deanebarker because I know you had some opinions on this a while back.