<commit_before><?php

$mode = $data['mode'];

?><!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">

  <title><?php echo $data['wikiName']; ?></title>

  <base href="<?php echo $data['baseUrl']; ?>">

  <?php if ($mode == 'edit') { ?>
  <!-- build:css client/edit.css -->
  <link href="client/libs/CodeMirror/lib/codemirror.css" rel="stylesheet">
  <link href="client/libs/CodeMirror/theme/railscasts.css" rel="stylesheet">
  <!-- endbuild -->
  <?php } // if ($mode == 'edit') ?>

  <!-- build:css client/view.css -->
  <!--
   | Styles see: https://highlightjs.org/static/demo/
   | Good bright styles: default, color-brewer, github, idea
   | Good dark styles:   agate, androidstudio, hybrid, railscasts, sunburst, tomorrow-night
   +-->
  <link href="client/libs/highlightjs/styles/idea.css" rel="stylesheet">

  <link href=".tmp/app-view.css" rel="stylesheet" />
  <!-- endbuild -->

</head>
<body class="mode-<?php echo $mode; ?>">

<?php
if ($mode == 'edit') {
?><div id="editor-wrapper">
  <textarea id="editor"><?php echo str_replace('<', '&lt;', $data['articleMarkdown']); ?></textarea>
</div>
<div class="close-edit-mode"><a class="btn btn-default" href="<?php echo $data['requestPath']; ?>">X</a></div><?php
} // if ($mode == 'edit')

?>
<div id="main-wrapper"><?php

  if ($mode == 'view' || $mode == 'edit') {
  ?>
  <nav class="breadcrumbs"><div class="main-column"><?php
    $isFirst = true;
    foreach ($data['breadcrumbs'] as $item) {
      if (! $isFirst) {
        echo ' / ';
      }
      if ($item['active']) {
        echo $item['name'];
      } else {
        ?><a href="<?php echo $data['basePath'] . $item['path'] . (($mode == 'edit') ? '?edit' : ''); ?>"><?php echo $item['name']; ?></a><?php
      }
      $isFirst = false;
    }
    if ($data['showCreateUserButton']) {
      ?><a class="btn btn-default btn-xs pull-right" href="<?php echo $data['requestPath']; ?>?createUser"><?php echo $i18n['button.createUser']; ?></a><?php
    }
    if ($mode == 'view') {
      ?><a class="btn btn-default btn-xs pull-right" href="<?php echo $data['requestPath']; ?>?edit"><?php echo $i18n['button.edit']; ?></a><?php
    }
  ?></div></nav>
  <article id="content" class="markdown main-column"><?php echo $data['articleHtml']; ?></article>
  <?php
  } // if ($mode == 'view' || $mode == 'edit')

  if ($mode == 'createUser') {
  ?>
  <form onsubmit="return false">
    <div class="form-group">
      <label for="user"><?php echo $i18n['createUser.userName']; ?></label>
      <input type="text" class="form-control" id="user" placeholder="<?php echo $i18n['createUser.userName']; ?>">
    </div>
    <div class="form-group">
      <label for="password"><?php echo $i18n['createUser.password']; ?></label>
      <input type="password" class="form-control" id="password" placeholder="<?php echo $i18n['createUser.password']; ?>">
    </div>
    <button id="showConfigBtn" class="btn btn-primary"><?php echo $i18n['createUser.showConfig']; ?></button>
    <a class="btn btn-default pull-right" href="<?php echo $data['requestPath']; ?>"><?php echo $i18n['button.cancel']; ?></a>
    <div id="result-box" class="markdown">
      <?php echo $i18n['createUser.addToConfig']; ?>
      <pre><code id="result"></code></pre>
    </div>
  </form>
  <?php
  } // if ($mode == 'createUser')

  if (isset($data['footerHtml'])) {
    ?><footer><div class="main-column"><?php echo $data['footerHtml']; ?></div></footer><?php
  }

?></div><?php // id="main-wrapper" ?>

<script type="text/javascript">
  window.slimwiki = <?php
    $settings = array(
      "mode" => $mode
    );
    if ($mode == 'edit') {
      $settings['articleFilename'] = $data['articleFilename'];
    }
    echo json_encode(array( "settings" => $settings ));
  ?>;
</script>

<?php if ($mode == 'edit') { ?>
<!-- build:js client/edit.js -->
<script src="client/libs/CodeMirror/lib/codemirror.js"></script>
<script src="client/libs/CodeMirror/addon/mode/overlay.js"></script> <!-- Allow language-in-language -->
<script src="client/libs/CodeMirror/mode/markdown/markdown.js"></script>
<script src="client/libs/CodeMirror/mode/gfm/gfm-patched.js"></script>

<!-- Nested languages -->
<script src="client/libs/CodeMirror/mode/clike/clike.js"></script>
<script src="client/libs/CodeMirror/mode/css/css.js"></script>
<script src="client/libs/CodeMirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="client/libs/CodeMirror/mode/javascript/javascript.js"></script>
<script src="client/libs/CodeMirror/mode/xml/xml.js"></script>

<script src="client/libs/CodeMirror/mode/meta.js"></script>

<script src="client/js/app-edit.js"></script>
<!-- endbuild -->
<?php } // if ($mode == 'edit') ?>

<!-- build:js client/view.js -->
<script src="client/libs/highlightjs/highlight.pack.js"></script>

<script src="client/js/app-view.js"></script>
<!-- endbuild -->

</body>
</html>
<commit_msg>Showing page name in title<commit_after><?php

$mode = $data['mode'];

?><!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0">

  <title><?php
    if (count($data['breadcrumbs']) > 1) {
      // Show page name in title
      echo end($data['breadcrumbs'])['name'] . ' &middot; ';
    }
    echo $data['wikiName'];
  ?></title>

  <base href="<?php echo $data['baseUrl']; ?>">

  <?php if ($mode == 'edit') { ?>
  <!-- build:css client/edit.css -->
  <link href="client/libs/CodeMirror/lib/codemirror.css" rel="stylesheet">
  <link href="client/libs/CodeMirror/theme/railscasts.css" rel="stylesheet">
  <!-- endbuild -->
  <?php } // if ($mode == 'edit') ?>

  <!-- build:css client/view.css -->
  <!--
   | Styles see: https://highlightjs.org/static/demo/
   | Good bright styles: default, color-brewer, github, idea
   | Good dark styles:   agate, androidstudio, hybrid, railscasts, sunburst, tomorrow-night
   +-->
  <link href="client/libs/highlightjs/styles/idea.css" rel="stylesheet">

  <link href=".tmp/app-view.css" rel="stylesheet" />
  <!-- endbuild -->

</head>
<body class="mode-<?php echo $mode; ?>">

<?php
if ($mode == 'edit') {
?><div id="editor-wrapper">
  <textarea id="editor"><?php echo str_replace('<', '&lt;', $data['articleMarkdown']); ?></textarea>
</div>
<div class="close-edit-mode"><a class="btn btn-default" href="<?php echo $data['requestPath']; ?>">X</a></div><?php
} // if ($mode == 'edit')

?>
<div id="main-wrapper"><?php

  if ($mode == 'view' || $mode == 'edit') {
  ?>
  <nav class="breadcrumbs"><div class="main-column"><?php
    $isFirst = true;
    foreach ($data['breadcrumbs'] as $item) {
      if (! $isFirst) {
        echo ' / ';
      }
      if ($item['active']) {
        echo $item['name'];
      } else {
        ?><a href="<?php echo $data['basePath'] . $item['path'] . (($mode == 'edit') ? '?edit' : ''); ?>"><?php echo $item['name']; ?></a><?php
      }
      $isFirst = false;
    }
    if ($data['showCreateUserButton']) {
      ?><a class="btn btn-default btn-xs pull-right" href="<?php echo $data['requestPath']; ?>?createUser"><?php echo $i18n['button.createUser']; ?></a><?php
    }
    if ($mode == 'view') {
      ?><a class="btn btn-default btn-xs pull-right" href="<?php echo $data['requestPath']; ?>?edit"><?php echo $i18n['button.edit']; ?></a><?php
    }
  ?></div></nav>
  <article id="content" class="markdown main-column"><?php echo $data['articleHtml']; ?></article>
  <?php
  } // if ($mode == 'view' || $mode == 'edit')

  if ($mode == 'createUser') {
  ?>
  <form onsubmit="return false">
    <div class="form-group">
      <label for="user"><?php echo $i18n['createUser.userName']; ?></label>
      <input type="text" class="form-control" id="user" placeholder="<?php echo $i18n['createUser.userName']; ?>">
    </div>
    <div class="form-group">
      <label for="password"><?php echo $i18n['createUser.password']; ?></label>
      <input type="password" class="form-control" id="password" placeholder="<?php echo $i18n['createUser.password']; ?>">
    </div>
    <button id="showConfigBtn" class="btn btn-primary"><?php echo $i18n['createUser.showConfig']; ?></button>
    <a class="btn btn-default pull-right" href="<?php echo $data['requestPath']; ?>"><?php echo $i18n['button.cancel']; ?></a>
    <div id="result-box" class="markdown">
      <?php echo $i18n['createUser.addToConfig']; ?>
      <pre><code id="result"></code></pre>
    </div>
  </form>
  <?php
  } // if ($mode == 'createUser')

  if (isset($data['footerHtml'])) {
    ?><footer><div class="main-column"><?php echo $data['footerHtml']; ?></div></footer><?php
  }

?></div><?php // id="main-wrapper" ?>

<script type="text/javascript">
  window.slimwiki = <?php
    $settings = array(
      "mode" => $mode
    );
    if ($mode == 'edit') {
      $settings['articleFilename'] = $data['articleFilename'];
    }
    echo json_encode(array( "settings" => $settings ));
  ?>;
</script>

<?php if ($mode == 'edit') { ?>
<!-- build:js client/edit.js -->
<script src="client/libs/CodeMirror/lib/codemirror.js"></script>
<script src="client/libs/CodeMirror/addon/mode/overlay.js"></script> <!-- Allow language-in-language -->
<script src="client/libs/CodeMirror/mode/markdown/markdown.js"></script>
<script src="client/libs/CodeMirror/mode/gfm/gfm-patched.js"></script>

<!-- Nested languages -->
<script src="client/libs/CodeMirror/mode/clike/clike.js"></script>
<script src="client/libs/CodeMirror/mode/css/css.js"></script>
<script src="client/libs/CodeMirror/mode/htmlmixed/htmlmixed.js"></script>
<script src="client/libs/CodeMirror/mode/javascript/javascript.js"></script>
<script src="client/libs/CodeMirror/mode/xml/xml.js"></script>

<script src="client/libs/CodeMirror/mode/meta.js"></script>

<script src="client/js/app-edit.js"></script>
<!-- endbuild -->
<?php } // if ($mode == 'edit') ?>

<!-- build:js client/view.js -->
<script src="client/libs/highlightjs/highlight.pack.js"></script>

<script src="client/js/app-view.js"></script>
<!-- endbuild -->

</body>
</html>

{'fraction_non_alphanumeric': 0.24306640625, 'fraction_numerical': 0.00458984375, 'mean_word_length': 4.020098039215687, 'pattern_counts': {'":': 0, '<': 289, '<?xml version=': 0, '>': 292, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '744141', 'n_tokens_mistral': 3547, 'n_tokens_neox': 3509, 'n_words': 663}