Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once './libs/markdown.php';
- $plain_text = "";
- $html_text = "";
- if ( isset($_REQUEST['texto']))
- {
- $plain_text = $_REQUEST["texto"];
- $html_text = Markdown( $plain_text );
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Markdow preview</title>
- <style type="text/css">
- #prev {
- width: 100%;
- height: 500px;
- overflow: scroll;
- overflow-x: auto;
- border: solid 1px #000000;
- }
- #formulario {
- width: 100%;
- height: 40%;
- }
- #formulario textarea {
- width: 100%;
- height: 200px;
- }
- </style>
- </head>
- <body>
- <section id="prev" class="wikistyle">
- <?php echo $html_text; ?>
- </section>
- <section id="formulario">
- <form id="markdow" action="md.php" method="post">
- <textarea name="texto" id="texto"><?php echo $plain_text; ?></textarea><br/>
- <input type="submit" value="testar" />
- </form>
- </section>
- </body>
- <!-- kibada da página do GitHub para formatar o texto -->
- <style type="text/css">
- .wikistyle h1, .wikistyle h2, .wikistyle h3, .wikistyle h4, .wikistyle h5, .wikistyle h6 {
- border: 0 none !important;
- }
- .wikistyle h1 {
- border-top: 4px solid #AAAAAA !important;
- font-size: 170% !important;
- margin-top: 1.5em !important;
- padding-top: 0.5em !important;
- }
- .wikistyle h1:first-child {
- border-top: medium none !important;
- margin-top: 0 !important;
- padding-top: 0.25em !important;
- }
- .wikistyle h2 {
- border-top: 4px solid #E0E0E0 !important;
- font-size: 150% !important;
- margin-top: 1.5em !important;
- padding-top: 0.5em !important;
- }
- .wikistyle h3 {
- margin-top: 1em !important;
- }
- .wikistyle hr {
- border: 1px solid #DDDDDD;
- }
- .wikistyle p {
- line-height: 1.5em !important;
- margin: 1em 0 !important;
- }
- .wikistyle a.absent {
- color: #AA0000;
- }
- .wikistyle ul, #wiki-form .content-body ul {
- margin: 1em 0 1em 2em !important;
- }
- .wikistyle ol, #wiki-form .content-body ol {
- margin: 1em 0 1em 2em !important;
- }
- .wikistyle ul li, #wiki-form .content-body ul li, .wikistyle ol li, #wiki-form .content-body ol li {
- margin-bottom: 0.5em;
- margin-top: 0.5em;
- }
- .wikistyle ul ul, .wikistyle ul ol, .wikistyle ol ol, .wikistyle ol ul, #wiki-form .content-body ul ul, #wiki-form .content-body ul ol, #wiki-form .content-body ol ol, #wiki-form .content-body ol ul {
- margin-bottom: 0 !important;
- margin-top: 0 !important;
- }
- .wikistyle blockquote {
- border-left: 5px solid #DDDDDD !important;
- color: #555555 !important;
- margin: 1em 0 !important;
- padding-left: 0.6em !important;
- }
- .wikistyle dt {
- font-weight: bold !important;
- margin-left: 1em !important;
- }
- .wikistyle dd {
- margin-bottom: 1em !important;
- margin-left: 2em !important;
- }
- .wikistyle table {
- margin: 1em 0 !important;
- }
- .wikistyle table th {
- border-bottom: 1px solid #BBBBBB !important;
- padding: 0.2em 1em !important;
- }
- .wikistyle table td {
- border-bottom: 1px solid #DDDDDD !important;
- padding: 0.2em 1em !important;
- }
- .wikistyle a code, .wikistyle a:link code, .wikistyle a:visited code {
- color: #4183C4 !important;
- }
- .wikistyle img {
- max-width: 100%;
- }
- .wikistyle pre.console {
- background-color: black !important;
- color: white !important;
- font-size: 12px !important;
- line-height: 1.5em !important;
- margin: 1em 0 !important;
- padding: 0.5em !important;
- }
- .wikistyle pre.console code {
- background-color: black !important;
- border: medium none !important;
- color: white !important;
- font-size: 12px !important;
- padding: 0 !important;
- }
- .wikistyle pre.console span {
- color: #888888 !important;
- }
- .wikistyle pre.console span.command {
- color: yellow !important;
- }
- .wikistyle .frame {
- display: inline-block;
- margin: 0;
- }
- .wikistyle .frame img {
- display: block;
- }
- .wikistyle .frame > span {
- border: 1px solid #AAAAAA;
- display: block;
- padding: 4px;
- }
- .wikistyle .frame span span {
- display: block;
- font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;
- font-size: 10pt;
- line-height: 10pt;
- margin: 0;
- padding: 4px 0 2px;
- text-align: center;
- }
- .wikistyle .float-left {
- float: left;
- padding: 0.5em 1em 0.25em 0;
- }
- .wikistyle .float-right {
- float: right;
- padding: 0.5em 0 0.25em 1em;
- }
- .wikistyle .align-left {
- display: block;
- text-align: left;
- }
- .wikistyle .align-center {
- display: block;
- text-align: center;
- }
- .wikistyle .align-right {
- display: block;
- text-align: right;
- }
- .wikistyle pre {
- background-color: #EEEEEE;
- border: 1px solid #DDDDDD;
- border-radius: 3px 3px 3px 3px;
- color: #444444;
- font-size: 12px;
- line-height: 1.5em;
- margin: 1em 0;
- overflow: auto;
- padding: 5px;
- }
- .wikistyle pre code {
- background-color: #EEEEEE !important;
- border: medium none !important;
- font-size: 12px !important;
- padding: 0 !important;
- }
- .wikistyle code {
- background-color: #F8F8FF !important;
- border: 1px solid #DEDEDE !important;
- color: #444444 !important;
- font-size: 12px !important;
- padding: 0 0.2em !important;
- }
- .markdown-format .highlight pre {
- background: none repeat scroll 0 0 #FAFAFA;
- line-height: 12px;
- }
- .markdown-format .highlight .gu, .markdown-format .highlight .gd, .markdown-format .highlight .gi {
- display: inline-block;
- margin-left: -5px;
- padding: 0 0 0 5px;
- width: 100%;
- }
- .markdown-format .highlight .gu {
- background: none repeat scroll 0 0 #EAF2F5;
- color: #999999;
- font-weight: normal;
- }
- </style>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement