Skip to main content

Posts

Convert Markdown or md URL to HTML - MarkdownToHTML - Using JavaScript ft. showdownjs

Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber and Aaron Swartz created Markdown in 2004 as a markup language that is appealing to human readers in its source code form. Wikipedia Using Markdown you will write(code) less and get more(static content). Code given below are basic JavaScript Codes. Easy to Understand you can modify it and make the functions more dynamic. We will Use - showdownjs  to do so :-  https://github.com/SH20RAJ/markdowntohtml   Here is the code you can use to change your markdown to HTML and show the html on your Website. <script src="https://cdn.jsdelivr.net/npm/showdown/dist/showdown.min.js"></script> <div id="mycontent"></div> <script> var converter = new showdown.Converter(); var md = '[**Showdown**](http://www.showdownjs.com) is *great*\n' + 'because:\n\n' + ...

Hide or show Elements in HTML Using JavaScript and Css

 Hide or show Elements in HTML Using JavaScript and Css Steps :- For This Firstly create a . hidden class where the css display property is set to " none ". <style> .hidden{ display:none; } </style> Then Using JavaScript we will toggle (add / remove) the hidden class from the element. So that results hiding and showing of the div/any other  element. Creating a JavaScript function to hide/show elements. <script> function hideunhide(a){ document.querySelector(a).classList.toggle('hidden'); } </script> This function takes a parameter ( queryselector ) and select the element and add or remove hidden from the class list of the element. If hidden is present it will remove and vice-versa .That's the work of toggle. See the Demo Below or on CXDI - Tutorials :-  https://tutorials.sh20raj.repl.co/hide-or-show-elements-in-html-using-javascript-and-css/ . Demo Codes :-  htt...

How to embed google map in html/blogger using iframe

 How to embed google map in html/blogger using iframe Google Maps + Search the location on Google Maps. + Click on the Share Button. + Embed a map -> Select Size -> Copy the iframe HTML Code. + Use the html code to embed the map on your website or blogger.

Code/Syntax Highlighting Using highlight.js - Show Codes on Website/Blogger

Code/Syntax Highlighting Using highlight.js - Show Codes on Website/Blogger Code/Syntax Highlighting Solutions Playlist :- Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It can work with pretty much any markup, doesn’t depend on any other frameworks, and has automatic language detection. Website   GitHub   See More Documentation on GitHub ->  https://github.com/highlightjs/highlight.js/blob/main/README.md See Doc on Repl.it  :-  https://replit.com/@SH20RAJ/Tutorials#highlightjs/index.html See Demo Here ( CXDI - Tutorials ) :-  https://tutorials.sh20raj.repl.co/highlightjs/ A Basic way to integrate hljs (for more see GitHub) +  Add the JavaScript CDN & Code Just before ending of <body> Tag. <link rel="style...

Random Posts