How do I theme external hyperlinks differently with mkdocs? - mkdocs

I am using mkdocs with material theme and I am looking for a way to make all external links render differently than internal ones, so people will know when they point for external resources.
Wikipedia is a very good example of site that does represent external links with an extra icon after them, making navigation easier.

Related

How can I re-use the navigation bar in multiple pages (Bootstrap)

I will keep this short. Simply, I got a navigation bar that I have in <index.html>. How can I reuse that navigation bar on a different page than index?
The functionality you are looking for is referred to as templating. Templating allows you to create blocks of HTML that can be included and re-used various places throughout a web page/site.
For static content (plain HTML pages), Gatsby, Hugo, and Jekyll are all good choices with lots of documentation and strong community support.
Quite simple
Just copy the code of that navigation bar from index.html
And paste it on ur other page...

separate theme from content in jekyll?

As indicated in this similar question (Switch theme in an existing Jekyll installation) there are many jekyll themes to choose from.
I would like to keep my own content separate from the jekyll theme used.
Is there a good (standard?) way of structuring a jekyll project so that your content can be kept distinct from the theme?
Most of your content is kept separate but there is a little bleedover.
This is evident from the answer to the linked question.
Changing the theme later can become a painpoint.
Ideally I would like to structure the project such that there is a theme sub-directory or similar and the theme may be altered by pointing at a different sub-directory.
Doing this dynamically (making the web-site 'skinnable' would be nice to have but not essentiall).
Is there a dynamic theme theme somewhere?
Short answer: Yes, you can keep theme and content separate, but only if your site stays with the basic layout calls (default, page, post).
Longer explanation and exceptions: If your existing jekyll installation is pure: you have edited only the content in pages, posts and not created-used special layouts, then, you can use the jekyll-remote-theme plugin and the switch is seamless, assuming that the new theme is not doing something radical with the defaults.
If your existing theme has special layouts (e.g., splash.html and the new one does not have it) then your pages that employ the respective layout will become orphans (i.e., basic html with no special formatting).
I have switched an existing installation that had been extensively edited, so I got several orphan pages, which I had to manually switch to a layout that makes sense within the new theme.
In conclusion, you can keep content and theme separate in many common cases (e.g., personal blog), but not if you want a custom solution (e.g., personal portfolio with gallery and splash pages).
Jekyll is tool that allow content separation beautifully, be it also from theme files. It's not about standard structuring - although following points will help out.
Do not move or disturb structure of theme files as it may be bought from 3rd party.
Create content as blocks and put jekyll code to insert them at runtime in theme. So if you want header somewhere you can insert {% include head.html %}. Also have a look at contentblocks plugin.

What's the lazy person's way of implementing material design styling using Polymer 1.x?

When it comes to styling a forms based web app (or pages, components, etc.), how do I build it using the least amount of CSS, style tags, style classes, and style attributes possible?
My understanding was that the paper-* elements implement an opinionated material design style that can be used to build components with similar material design out-of-the-box.
I'm trying to build an internal app for employees at my company (thus, as long as it's not bad, styling is not that important). It's basically a bunch of forms pages that look like many of the protoypical menu-driven web sites (like the polymer docs pages):
Nav menu on the left
Menu selected content on the right - text reports and forms mostly
header/logo on top
However, when I tried to copy some things (like item list boxes) out of the elements catalog like the paper-item demos I couldn't match the look in my components simply by copying the HTML. The demo HTML referenced classes for which I had to copy a bunch of <style> tags in order to get them to work.
It felt like a lot of re-inventing the wheel to copy an often repeated look.
I'm not sure if I understand your problem. The paper-* elements aren't meant to build components, they ARE components. If you want to use them you have to go the full way. If you use them as intended, they look like in the demos out of the box. You can't just copy the HTML. A more traditional way to get the material-design-look is Materialize or Googles own MaterialDesignLite.

How to keep the styles of webpage the same

I want to know if there is a way to create a form that will keep all styles of a webpage, while changing the content of the content of the page. Ex: When you submit a question to Stackoverflow, it keeps the all stylistic parts of the page, i.e. Header and sidebars, while changing the title and majority of page's content. Also if you can would a server-side languange, such as php, be best or would a web-side languange, such as Javascript, be best
You can do this by css also you can devide the page into many files
such as putting the header in another page (header.html) and include it in the main page using php (include_once('header.html'))
Style sheets (CSS) exist for exactly this task. Ideally, the HTML for a page contains only its content, while style sheets contain all presentation (the "look"/"format" of the page). Reusing the same style sheet(s) on most or all pages results in a consistent look across an entire website.
See http://www.w3schools.com/css/ for more general information and tutorials.
Edit If you're referring more to reusing "structural" markup across pages, that is accomplished using a template engine. Using templates things like primary navigation, sidebars, etc. can be defined in one file and used on any page that extends the base template. Many web frameworks have a template engine built-in (Django, for example has one I personally use and like).
This is handled using CSS. Basically, websites are built using HTML, CSS, and JavaScript.
HTML builds the structure of the website. It creates the basic building blocks of the site.
CSS takes care of how the website looks. It stylizes the building blocks.
JavaScript takes care of the functionality of the website. It can manipulate the building blocks in order to make something happen.
In order to maintain the same look of certain elements on a website, it is best to create a so called pattern library. A pattern library is a document consisting of pieces of code—these pieces can be reused throughout the website in order to maintain consistence. In this document, you specify the formatting of the essential elements (headings, body text, blockquotes, buttons, form elements etc. (Pattern libraries are sometimes also referred to as "style guides", however, style guides are usually visual documents, while pattern libraries are consisting of pieces of code.)
Of course you can specify the look of your website without using a pattern library, however, it might get a bit harder to maintain the same style throughout the whole website or keep the styling the same when handing the project over to another developer.
You can read more about pattern libraries in this post if you feel like it.

HTML : Parse, Analyze, and Reconstruct in mobile site

I am working on a school project for me CS class where we are to find an application that is interesting to us and figure out how it works.
I have picked the technology on dudamobile.com
The app takes a URL and then converts the desktop version of a website into a mobile version.
I think I have a basic understanding out how this works....
Clean up the HTML
Parse the HTML and look for key tags
Store key tags in variables
Apply variables to a premade mobile HTML template
insert custom CSS to fit mobile devices
This is a pretty high level analysis, my question is what specific tools can I use to create something similar for my project? Is my analysis correct, in your opinion?
To me it just looks like they strip out large sections of css and replace it with more mobile friendly and less graphic intensive css. It also seems to choose odd links in navigation to make the top links so some kind of algorithm there (the top links of my site were all the ones I had for mobile devices).
I would start by doing a few tricks on the css files the site uses and strip out background images, changing images over a certain width into block level elements, changing font size, etc. until you get it looking like more of a simple layout and then add the other mobile elements as you see fit (making it readable without zooming is probably the most important though).
If the site uses html5 you can apply different css rules to the navigation section to make it a list of links and move it to the top.
Don't expect it to be a perfect crossover unless the site is moderately simple though.
You would need a back end technology to retrieve and parse the .css file to re-serve it. I would suggest whatever language you're comfortable with. I don't have much experience in PHP but I believe it would be a good fit for that application.