Git Product home page Git Product logo

Comments (2)

nilsnolde avatar nilsnolde commented on May 25, 2024 1

Good suggestion! I often get annoyed when there's a title twice, one from the WP post and the other one from markdown.. Never thought about this solution (or any for that matter..).

I'll include this in the next batch of improvements, though not sure when that's gonna happen unfortunately.. Happy to review if you wanna give it a shot: somewhere between getting the raw markdown and requesting the rendered markdown here:

list($raw_markdown, $response_code) = $this->get_document();
switch ($response_code) {
case 200:
break;
case 404:
$raw_markdown = "# 404 - Not found\nDocument not found.";
break;
case 401:
$raw_markdown = "# 401 - Bad credentials.\nPlease review access token for user " . $this->user;
break;
case 403:
$raw_markdown = "# 403 - Bad credentials.\nPlease review access token for user " . $this->user;
break;
default:
$raw_markdown = "# 500 - Server Error.\n$raw_markdown";
}
$args = array(
'body' => json_encode(array(
"text" => $raw_markdown
)),
'headers' => array(
'Content-Type' => 'application/json'
)
);

from wordpress-markdown-git.

danilopinotti avatar danilopinotti commented on May 25, 2024 1

I liked this suggestion too.

@nilsnolde currently I use a workaround to avoid show the title twice:

/* My CSS */
.hidden-first-h1 h1:first-of-type {
  display: none;
}
// My post content

[git-add-css classes="hidden-first-h1"]
[git-github-markdown url="https://github.com/danilopinotti/blog-posts/blob/master/2021-03-13-explicando_operadores_bitwise.md?v=3"]
[/git-add-css]

from wordpress-markdown-git.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.