<commit_before>\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{include-markdown}[2016/08/22 Convert markdown to latex
and include the latex file]

\RequirePackage{ifthen}             % conditional commands in LaTeX documents

% build folder location
\def\buildfolder#1{\def\@buildfolder{#1}}
\newcommand{\printbuildfolder}{\@buildfolder}
\buildfolder{build} % set default folder

\newcommand\inputmarkdown[3]
% #1 = path,
% #2 = filename,
% #3 extra parameters.
%   "unlisted": unlisted chapter
{
    \immediate\write18{
        pandoc  % converter
        --chapters             % set first header to chapters
        ./#1/#2.md              % source
        -f markdown -t latex    % type specification
        -o \printbuildfolder/#2.tex         % destination/output
    }
    % check if generated file exists
    \IfFileExists{./\printbuildfolder/#2}{
        % if unlisted, make sure it wont go into ToC
        \ifthenelse{\equal{#3}{unlisted}} {
            \let\oldaddcontentsline\addcontentsline % copy old implementation
            \renewcommand{\addcontentsline}[3]{}    % redefine
        }{% false
        }
        % include generated file
        \input{./\printbuildfolder/#2}
        % if unlisted, make sure it wont go into ToC
        \ifthenelse{\equal{#3}{unlisted}} {<commit_msg>add listings support to include-markdown package<commit_after>\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{include-markdown}[2016/08/22 Convert markdown to latex
and include the latex file]

\RequirePackage{ifthen}             % conditional commands in LaTeX documents

% build folder location
\def\buildfolder#1{\def\@buildfolder{#1}}
\newcommand{\printbuildfolder}{\@buildfolder}
\buildfolder{build} % set default folder

\newcommand\inputmarkdown[3]
% #1 = path,
% #2 = filename,
% #3 extra parameters.
%   "unlisted": unlisted chapter
{
    \immediate\write18{
        pandoc  % converter
        --chapters              % set first header to chapters
        --listings              % use the listings package for LaTeX code blocks
        ./#1/#2.md              % source
        -f markdown -t latex    % type specification
        -o \printbuildfolder/#2.tex         % destination/output
    }
    % check if generated file exists
    \IfFileExists{./\printbuildfolder/#2}{
        % if unlisted, make sure it wont go into ToC
        \ifthenelse{\equal{#3}{unlisted}} {
            \let\oldaddcontentsline\addcontentsline % copy old implementation
            \renewcommand{\addcontentsline}[3]{}    % redefine
        }{% false
        }
        % include generated file
        \input{./\printbuildfolder/#2}
        % if unlisted, make sure it wont go into ToC
        \ifthenelse{\equal{#3}{unlisted}} {
{'fraction_non_alphanumeric': 0.11000369139904023, 'fraction_numerical': 0.01845699520118125, 'mean_word_length': 2.4610472541507025, 'pattern_counts': {'":': 2, '<': 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': '7312228', 'n_tokens_mistral': 808, 'n_tokens_neox': 759, 'n_words': 202}