Adding Carousel In MKdocs

Add the following style

/* Carousel Start  */
.carousel_wrapper {
  position: relative;
  width: 320px;
  height: 300px;
  margin: 100px auto 0 auto;
  padding: 5px;
  perspective: 1000px;
}

.carousel {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateY(-360deg) translateZ(-412px); /* add reverse transformation from the slides */
  animation: swirl 80s steps(10000, end) infinite; /* run `swirl` animation (defined at end of CSS) infitely, with animation 
 lasting 40 seconds, and 10,000 steps between the FROM and TO values in the animation for a smooth rotation */
}

.slide {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 300px;
  height: 187px;
}

.slide img {
  width: 280px;
  height: 175px;
  border: 3px inset rgba(0, 255, 34, 0.9);
  box-shadow: 0 0 10px 1px rgba(0, 255, 34, 0.9);
}

.slide.one {
  transform: rotateY(0deg) translateZ(412px);
}
.slide.two {
  transform: rotateY(40deg) translateZ(412px);
}
.slide.three {
  transform: rotateY(80deg) translateZ(412px);
}
.slide.four {
  transform: rotateY(120deg) translateZ(412px);
}
.slide.five {
  transform: rotateY(160deg) translateZ(412px);
}
.slide.six {
  transform: rotateY(200deg) translateZ(412px);
}
.slide.seven {
  transform: rotateY(240deg) translateZ(412px);
}
.slide.eight {
  transform: rotateY(280deg) translateZ(412px);
}
.slide.nine {
  transform: rotateY(320deg) translateZ(412px);
}

/*
CSS3 ANIMATION
-------------------
Simply rotates the carousel around the Y axis by using rotateY and starting at initial value, -360º, and going to final value 0º, 
then resetting.
*/

@keyframes swirl {   
  from {
    transform: rotateY(-360deg);
  }
  to {
    transform: rotateY(0deg);
  }
} 
/* Carousel Start */

Add the following HTML elements

<div class="carousel_wrapper">

 <div  class="carousel">
    
    <div class="slide one">
        <img src="/img/vision-svgrepo-com.svg" width="80px" />
        <div class="card-btn-container">
            <a href="/">
            <span>Learn More → </span>
            </a>
        </div>
    </div>

     <div class="slide two">
       <img src="/img/goal-svgrepo-com.svg" width="80px" />
       <div class="card-btn-container">
            <a href="/">
            <span>Learn More → </span>
            </a>
        </div>
    </div>

      <div class="slide three">
       <img src="/img/goal-svgrepo-com.svg" width="80px" />
       <div class="card-btn-container">
            <a href="/">
            <span>Learn More → </span>
            </a>
        </div>
    </div>

      <div class="slide four">
       <img src="/img/goal-svgrepo-com.svg" width="80px" />
       <div class="card-btn-container">
            <a href="/">
            <span>Learn More → </span>
            </a>
        </div>
    </div>

 </div>

</div>

Here is an example

Adding Pillar / Card In MKdocs

Add the following style

/*start Pillar style*/
.pillarwrapper {
  display: flex;
  padding: 20px 20px 0px 20px;
}

.pillarwrapper > div {
  flex-grow: 1;
  padding: 20px 20px 0px 20px;
  height:auto;
  overflow:hidden;
  transition: ease-in-out 200ms;
 /*box-shadow: 0.05rem 0.05rem 0.075rem 0.075rem gainsboro; */
  box-shadow: 0px 10px 10px rgba(30, 30, 30, 0.08);
  /*background: linear-gradient(to right bottom, #f7fafc, #fff);*/
  background-color: #ffffff;
  border-collapse: collapse;
  cursor: default; /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */  
}

.pillarwrapper > div:first-of-type { margin-right:10px }
.pillarwrapper > div:nth-of-type(2) { margin-right:10px }
.pillarwrapper > div:nth-of-type(3) {  }

.pillarwrapper > h2 { margin-top:0 margin-bottom:0 }

.pillarwrapper > div:hover {
  box-shadow: 0px 10px 20px rgba(30, 30, 30, 0.16);
}

.pillarcard {
padding-bottom:0px;
width:33vw;	
}	
.pillarcard img {
opacity: 0.8;
transition: ease-in-out 200ms;	
}
.pillarcard:hover img {
opacity: 1.0;
}
/*end Pillar style*/

Add the following HTML elements

<div class="pillarwrapper">
  <div align="center" class="pillarcard">

  <img src="img/vision-svgrepo-com.svg" width="80px" />  
  <h3 style="margin-top:0px">Getting Started</h3>
  
  <p style="margin-bottom: 0px">  
    Some Description
  </p>

  <div class="card-btn-container">
   <a href="getting-started/home/">
   <span>Click here to Get Started &rarr; </span>
   </a>
  </div>
  
  <hr style="margin-bottom: 0px margin-top: 0px" />
 

  <h3 style="margin-top: 0px">Carousel</h3>

  <p>Some big Description</p>
  
  <div class="card-btn-container">
   <a href="getting-started/carousel/">
   <span>Learn More &rarr; </span>
   </a>
  </div>

 </div>
</div>

Here is an example

Controlling Mkdocs Heading and Sidebars

Hiding Sidebars

Both Primary and secondary.

Just add the following at the start of markdown.

<style> 

@media only screen and (min-width: 60em) { .md-sidebar--secondary { display: none; } .md-content { margin-right: 0; margin-left: 0; padding:0; margin-top:0;max-width: 100%; } 
@media only screen and (min-width: 76.1875em) { .md-sidebar--primary { display: none; } .md-content { margin-right: 0; margin-left: 0; margin-top: 0; padding:0;max-width: 100%;} } 
.md-content__inner {margin-top: 0; padding-top: 0}

</style>

Here is an example

Only secondary

<style> 

@media only screen and (min-width: 50em) { .md-sidebar--secondary { display: none; } .md-content { margin-right: 0; margin-left: 0; padding:0; margin-top:0;max-width: 100%; } 
.md-content__inner {margin-top: 0; padding-top: 0}

</style>

Here is an example

Hiding Page Header

Just add empty h1 element at the start of markdown

<h1 style="padding:0 margin-top:0px"></h1> 

Here is an example

Document As Code Using MKdocs

An example website created using mkdocs

Install

pip install mkdocs-material
E:\mkdocs>mkdocs new doc-as-code
INFO    -  Creating project directory: doc-as-code
INFO    -  Writing config file: doc-as-code\mkdocs.yml
INFO    -  Writing initial docs: doc-as-code\docs\index.md
E:\mkdocs>code doc-as-code
mkdocs serve

Do any changes and the changes would reflect

Lets create the following, folders and file

Lets add tables.js under javascripts folder

app.document$.subscribe(function() {
  var tables = document.querySelectorAll("article table")
  tables.forEach(function(table) {
    new Tablesort(table)
  })
})

Lets add app-theme.css under styles.


/* Progress Bars */
.md-typeset 

.progress-label {
    position: absolute;
    text-align: center;
    font-weight: 700;
    width: 100%;
    margin: 0;
    line-height: 1.2rem;
    white-space: nowrap;
    overflow: hidden;
  }
  
  .progress-bar {
    height: 1.2rem;
    float: left;
    background-color: #2979ff;
  }
  
 .candystripe-animate .progress-bar {
    animation: animate-stripes 3s linear infinite;
 }

  .progress {
    display: block;
    width: 100%;
    margin: 0.5rem 0;
    height: 1.2rem;
    background-color: #eeeeee;
    position: relative;
  }
  
  .progress.thin {
    margin-top: 0.9rem;
    height: 0.4rem;
  }
  
  .progress.thin .progress-label {
    margin-top: -0.4rem;
  }
  
  .progress.thin .progress-bar {
    height: 0.4rem;
  }
  
  .progress.candystripe .progress-bar {
    background-image: linear-gradient(135deg, var(--md-progress-stripe) 27%, transparent 27%, transparent 52%, var(--md-progress-stripe) 52%, var(--md-progress-stripe) 77%, transparent 77%, transparent);
    background-size: px2rem(40px) px2rem(40px);
 }

 .progress.static.lightcyan .progress-bar {
    background-color:hsl(187deg 91% 47%);
  }
 
  .progress.static.blue .progress-bar {
    background-color:#2979ff;
  }

  .progress.static.verydarkcyan .progress-bar {
    background-color:hsl(187deg 39% 22%);
  }

  .progress.static.darkcyan .progress-bar {
    background-color:darkcyan;
  }

  .progress.static.blueviolet .progress-bar {
    background-color:blueviolet;
  }

  .progress.static.bisque .progress-bar {
    background-color:bisque;
  }

  .progress.static.darkgreen .progress-bar {
    background-color:darkgreen;
  }

  .progress.static.green .progress-bar {
    background-color:green;
  }

  .progress.static.orange .progress-bar {
    background-color:orange;
  }

  .progress.static.orangered .progress-bar {
    background-color:orangered;
  }

  .progress.static.olivedrab .progress-bar {
    background-color:olivedrab;
  }

  .progress.static.red .progress-bar {
    background-color:red;
  }

  
  .progress.static.gray .progress-bar {
    background-color:gray;
  }

  .progress.static.grey .progress-bar {
    background-color: hsl(0deg 5% 89%);
  }
  
  .progress-100plus .progress-bar {
    background-color: #00e676;
  }
  
  .progress-80plus .progress-bar {
    background-color: #fbc02d;
  }
  
  .progress-60plus .progress-bar {
    background-color: #ff9100;
  }
  
  .progress-40plus .progress-bar {
    background-color: #ff5252;
  }
  
  .progress-20plus .progress-bar {
    background-color: #ff1744;
  }
  
  .progress-0plus .progress-bar {
    background-color: #f50057;
  }

  @keyframes animate-stripes {
    0% {
        background-position: 0 0;
   }
    100% {
        background-position: px2rem(120px) 0;
   }
}

Lets add theme/partials/footer.html

{#-
    This file is required to override the default MkDocs footer - do not edit
  -#}
  {% import "partials/language.html" as lang with context %}
  <footer class="md-footer">
    {% if page.previous_page or page.next_page %}
      <div class="md-footer-nav">
        <nav class="md-footer-nav__inner md-grid">
          {% if page.previous_page %}
            <a href="{{ page.previous_page.url | url }}" title="{{ page.previous_page.title | striptags }}" class="md-flex md-footer-nav__link md-footer-nav__link--prev" rel="prev">
              <div class="md-flex__cell md-flex__cell--shrink">
                <i class="md-icon md-icon--arrow-back md-footer-nav__button"></i>
              </div>
              <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
                <span class="md-flex__ellipsis">
                  <span class="md-footer-nav__direction">
                    {{ lang.t("footer.previous") }}
                  </span>
                  {{ page.previous_page.title }}
                </span>
              </div>
            </a>
          {% endif %}
          {% if page.next_page %}
            <a href="{{ page.next_page.url | url }}" title="{{ page.next_page.title | striptags }}" class="md-flex md-footer-nav__link md-footer-nav__link--next" rel="next">
              <div class="md-flex__cell md-flex__cell--stretch md-footer-nav__title">
                <span class="md-flex__ellipsis">
                  <span class="md-footer-nav__direction">
                    {{ lang.t("footer.next") }}
                  </span>
                  {{ page.next_page.title }}
                </span>
              </div>
              <div class="md-flex__cell md-flex__cell--shrink">
                <i class="md-icon md-icon--arrow-forward md-footer-nav__button"></i>
              </div>
            </a>
          {% endif %}
        </nav>
      </div>
    {% endif %}    
  </footer>

Lets update the mkdocs.yml as follows

site_name: 'doc-as-code'
nav:
  - Home: index.md
repo_name: 'github/doc-as-code'
repo_url: 'https://github.com/mnadeem/doc-as-code'
edit_uri: 'blob/master/docs'
copyright: 'Copyright © 2020 App'

theme:
  name: material
  palette:
    primary: 'green'
    accent: 'green'
#  feature:
#    tabs: true
  custom_dir: 'theme'
  #favicon: img/favicon.ico
  #logo: img/logo.png
  icon:
    logo: material/file-document
  font:
    text: Arial
    code: Roboto Mono

extra:
  social:
    - type: 'github'
      link: 'https://github.com/mnadeem'
      icon: fontawesome/brands/github-alt

extra_css:
  - styles/app-theme.css
  - https://unpkg.com/[email protected]/dist/mermaid.css
     
extra_javascript:
  - https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js
  - javascripts/tables.js
  - https://unpkg.com/[email protected]/dist/mermaid.min.js

markdown_extensions:
  - meta
  - toc:
      permalink: true
  - admonition
  - footnotes
  - pymdownx.arithmatex
  - pymdownx.betterem:
      smart_enable: all
  - pymdownx.caret
  - attr_list
  - pymdownx.critic
  - pymdownx.details
  - pymdownx.inlinehilite
  - pymdownx.magiclink
  - pymdownx.mark
  - pymdownx.smartsymbols
  - pymdownx.highlight
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_div_format
  - pymdownx.tabbed
  - def_list
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.tilde
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg
  - pymdownx.snippets
  - pymdownx.progressbar
  - codehilite:
      linenums: true
mkdocs gh-deploy --force
 E:\mkdocs\doc-as-code>mkdocs gh-deploy --force
      INFO    -  Cleaning site directory
      INFO    -  Building documentation to directory: E:\mkdocs\doc-as-code\site
      INFO    -  Documentation built in 1.44 seconds
      INFO    -  Copying 'E:\mkdocs\doc-as-code\site' to 'gh-pages' branch and pushing to GitHub.
      INFO    -  Your documentation should shortly be available at: https://mnadeem.github.io/doc-as-code/

Add more pages

Add more navigations

nav:
  - Home: index.md
  - Getting Started:
    - Document As Code: getting-started/document-as-code.md
    - Creating Pages: getting-started/creating-pages.md
    - Creating Diagrams: getting-started/creating-diagrams.md

References