return $this->file;
}
+ /**
+ * Get edit URL
+ * @return string
+ */
+ public function getEditUrl() {
+ return $this->repo->getEditUrl($this->name);
+ }
+
/**
* Read the title of the ref entry file
* @return string
font-family: Inconsolata, Monospace, 'Courier New', Courier, monospace;
}
body {
- font-size: 1.5em;
+ font-size: 1.1em;
margin: 0;
padding: 0;
padding-bottom: 5em;
}
.sidebar {
- font-size: .9em;
float: right;
background: #f0f0f0;
border-bottom-left-radius: 10px;
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
text-decoration: none;
- color: white;
font-weight: bold;
text-shadow: 0 0 5px red;
}
+.sidebar .edit a {
+ color: white !important;
+}
code {
- display: inline-block;
border-radius: 2px;
padding: 0px 2px 2px 2px;
- background: #e0e0e0;
+ background: #f0f0f0;
color: #606060;
box-shadow: 0 0 1px #999;
}
}
pre>code {
+ display: inline-block;
padding: 1em;
min-width: 50%;
}
define("ROOT", dirname(__DIR__));
define("REFS", getenv("REFPATH") ?: implode(PATH_SEPARATOR, glob(ROOT."/refs/*")));
-ini_set("open_basedir", ROOT.":".REFS);
+#ini_set("open_basedir", ROOT.":".REFS);
$loader = require ROOT . "/vendor/autoload.php";
/* @var $loader \Composer\Autoload\ClassLoader */
<title>
<?php if (!empty($title)) : ?>
<?= $title ?> -
+ <?php elseif (isset($entry)) : ?>
+ <?= $entry ?> -
<?php endif; ?>
mdref
</title>
<?php endif; ?>
</li>
</ul>
+ <?php if (isset($entry)) : ?>
+ <div class="edit">
+ <a href="<?=$entry->getEditUrl()?>">Edit</a>
+ </div>
+ <?php endif; ?>
</div>