All this files should be placed at C:\Users\USERNAME\AppData\Roaming\Microsoft\Windows\SendTo\
And run through the right mouse button, select the folder, right-click and select Send To
Converter slug to filename
Version for YAML Front Matter.
slug2name.cmd
@echo off
pushd "%~1"
for /f %%A in ('dir /a-d/b "*.m*"') do (
for /f "tokens=1* delims=:" %%B in ('type "%%A"^| findstr /b slug:') do (
for /f "tokens=*" %%D in ("%%C") do (
if "%%A" neq "%%D%%~xA" (
rename %%A %%D%%~xA
echo %%A =^> %%D%%~xA
)
)
)
)
pause
Converter article.md to article/index.md
file2folder.cmd
pushd "%~1"
for /f "delims=. tokens=1" %%a in ('dir /a-d/b "*.md"') do (
if not %%~a==index (
mkdir %%~a
move /Y %%~a.md %%~a\index.md
)
)
for /f "delims=. tokens=1" %%a in ('dir /a-d/b "*.mmark"') do (
if not %%~a==index (
mkdir %%~a
move /Y %%~a.mmark %%~a\index.mmark
)
)
pause
Converter article/index.md to article.md
folder2file.cmd
pushd "%~1"
for /f "tokens=*" %%A in ('dir /ad/b') do (
if exist .\%%A\index.md (
move /Y .\%%A\index.md %%A.md
rmdir %%A
)
)
for /f "tokens=*" %%A in ('dir /ad/b') do (
if exist .\%%A\index.mmark (
move /Y .\%%A\index.mmark %%A.mmark
rmdir %%A
)
)
pause
Generator index.md
for file structure like article.md
Version for YAML Front Matter.
dir2list.cmd
pushd "%~1"
if exist index.md (
rename index.md index.%date:.=%.bak
)
for /f %%A in ('dir /a-d/b "*.m*"') do (
for /f "tokens=1* delims=:" %%B in ('type "%%A"^| findstr /b title:') do (
for /f "tokens=*" %%D in ("%%C") do (
for /f "delims='" %%E in ("%%~D") do (
echo - [%%E](%%~nA/^)>>index.md
echo.>>index.md
)
)
)
)
pause
Generator index.md
for file structure like article/index.md
Version for YAML Front Matter.
subdir2list.cmd
pushd "%~1"
if exist index.md (
rename index.md index.%date:.=%.bak
)
for /f %%A in ('dir /ad/b') do (
for /f "tokens=1* delims=:" %%B in ('type ".\%%A\index.md" ^|findstr /B title:') do (
for /f "tokens=*" %%D in ("%%C") do (
for /f "delims='" %%E in ("%%~D") do (
echo - [%%E](%%~nA/^)>>index.md
echo.>>index.md
)
)
)
)
pause