%%
%% This is file `scontents.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% scontents.dtx  (with options: `loader,plain')
%% 
%% Copyright (C) 2019-2025 by Pablo González L <pablgonz@educarchile.cl>
%% 
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3c of this license or (at
%% your option) any later version. The latest version of this license is in
%% 
%%  https://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
%% This work is "maintained" (as per the LPPL maintenance status)
%% by Pablo González Luengo.
%% 
%% This work consists of the files scontents.dtx and
%%                                 scontents.ins,
%% and the derived files           scontents.sty,
%%                                 scontents.tex,
%%                                 t-scontents.mkiv and
%%                                 scontents-code.tex.
%% 
\def\ScontentsFileDate{2025-11-20}%
\def\ScontentsFileVersion{2.6}%
\def\ScontentsFileDescription{Stores LaTeX contents in memory or files}%
\input expl3-generic.tex
\ExplSyntaxOn
\str_const:ce { c__scontents_version_str } { \ScontentsFileDate\space
  v\ScontentsFileVersion\space \ScontentsFileDescription }
\iow_log:e { Package: ~ scontents ~ \str_use:c { c__scontents_version_str } }
\int_new:N  \l__scontents_char_value_int
\int_set:Nn \l__scontents_char_value_int { \char_value_catcode:n { `\@ } }
\char_set_catcode_letter:N \@
\file_input:n { xparse-generic.tex }
\char_set_catcode:nn { `\@ } { \l__scontents_char_value_int }
\cs_if_exist:NF \tl_retokenize:n
  {
    \msg_new:nnn { scontents } { expl-too-old }
      {
        Please~install~an~up~to~date~TeX~distribution~or~update~using~
        your~TeX~package~manager~or~from~CTAN. \\
        See~documentation.~Loading~scontents~will~abort!
      }
    \msg_fatal:nn { scontents } { expl-too-old }
    \ExplSyntaxOff
    \file_input_stop:
  }
\tl_if_exist:NT \l__scontents_cmd_name_tl
  {
    \msg_new:nnn { scontents } { already-loaded }
      {
        The~'scontents'~package~is~already~loaded.~Aborting~input~\msg_line_context:.
      }
    \msg_warning:nn { scontents } { already-loaded }
    \ExplSyntaxOff
    \file_input_stop:
  }
\cs_new:Npn \__scontents_format_case:nnn #1 #2 #3
  {#2} % Plain/Generic
\tl_const:Ne \c__scontents_newline_tl { \iow_char:N \^^J }
\tl_new:N \g__scontents_end_verbatimsc_tl
\tl_gset_rescan:Nnn \g__scontents_end_verbatimsc_tl
  {
    \char_set_catcode_other:N \\
  }
  { \endverbatimsc }
\tl_new:N    \l__scontents_env_name_tl
\tl_const:Ne \c__scontents_end_env_tl
  {
    \c_backslash_str
    end
      \exp_not:N \l__scontents_env_name_tl
  }
\file_input:n { scontents-code.tex }
\keys_define:nn { scontents }
  { verb-font .initial:n = \tt }
\bool_new:N \l__scontents_plain_bool
\group_begin:
  \char_set_catcode_active:n { `\* }
  \cs_new_protected:Nn \__scontents_plain_disable_outer_par:
    {
      \group_begin:
        \char_set_lccode:nn { `\* } { `\^^L }
        \tex_lowercase:D { \group_end:
        \tex_let:D * \scan_stop:
      }
    }
\group_end:
\cs_new_protected:Npn \__scontents_analyse_nesting_format:n
  { \__scontents_analyse_nesting_generic:nn { } }
\cs_new_protected:Npn \__scontents_define_env:nnn #1 #2 #3
  {
    \NewDocumentEnvironment {#1} { }
      {
        \group_begin:
          #2
      }
      {
          #3
        \group_end:
      }
  }
\NewDocumentCommand \newenvsc { m O{} }
  {
    \cs_if_exist:cTF { #1 }
      { \msg_error:nnn { scontents } { env-already-defined } {#1} }
      { \__scontents_setting_env:nn {#1} {#2} }
  }
\newenvsc{scontents}
\cs_if_exist:NF \dospecials
  {
    \cs_new:Npn \dospecials
      { \seq_map_function:NN \l_char_special_seq \do }
  }
\use:e
  {
    \cs_new_protected:Npn \exp_not:N \__scontents_xverb:w
      #1 \g__scontents_end_verbatimsc_tl
      { #1 \exp_not:N \endverbatimsc }
  }
\cs_new_protected:Npn \verbatimsc
  {
    \group_begin:
      \__scontents_verbatimsc_aux: \frenchspacing \__scontents_vobeyspaces:
      \__scontents_xverb:
  }
\cs_new_protected:Npn \endverbatimsc
  { \group_end: }
\cs_new_protected:Nn \__scontents_verbatimsc_aux:
  {
    \skip_vertical:N \parskip
    \dim_zero:N \parindent
    \skip_set:Nn \parfillskip { 0pt plus 1fil }
    \skip_set:Nn \parskip { 0pt plus0pt minus0pt }
    \tex_par:D
    \bool_set_false:N \l__scontents_plain_bool
    \cs_set:Npn \par
      {
        \bool_if:NTF \l__scontents_plain_bool
          {
            \mode_leave_vertical:
            \null
            \tex_par:D
            \penalty \interlinepenalty
          }
          {
            \bool_set_true:N \l__scontents_plain_bool
            \mode_if_horizontal:T
              { \tex_par:D \penalty \interlinepenalty }
          }
      }
    \cs_set_eq:NN \do \char_set_catcode_other:N
    \dospecials \obeylines
    \tl_use:N \l__scontents_verb_font_tl
    \cs_set_eq:NN \do \__scontents_do_noligs:N
    \__scontents_nolig_list:
    \tex_everypar:D \exp_after:wN
      { \tex_the:D \tex_everypar:D \tex_unpenalty:D }
  }
\cs_new_protected:Nn \__scontents_nolig_list:
  { \do\`\do\<\do\>\do\,\do\'\do\- }
\cs_new_protected:Nn \__scontents_vobeyspaces:
  { \__scontents_set_active_eq:NN \  \__scontents_xobeysp: }
\cs_new_protected:Nn \__scontents_xobeysp:
  { \mode_leave_vertical: \nobreak \ }
\ExplSyntaxOff
\endinput
%% 
%%
%% End of file `scontents.tex'.
