Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
FAQ Markup Language
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.rvmrc
Gemfile
Gemfile.lock
README.markdown
faqml.gemspec

README.markdown

FML

The FAQ Markup Language. It's pretty simple. The gem is called faqml, so first install it. Then just access it through Tilt.

require 'rubygems'
require 'faqml'
require 'tilt'
puts Tilt.new('mypage.fml').render

Your markup in mypage.fml should be valid markdown. The only difference is, that QnA blocks are started by the keyword "question:", or "Q:", and answers being with "answer:" or "A:". If there is any text on the line after the question or answer keywords, it will be that section's summary (neither are required). All remaining indented text consitute the body of the question of answer.

This FML

question: What kind of Bear is Best?
  I hear there are basically two school of thought.
answer:
  False. *Blackbear*.

Q: Do Bears eat Beats?
A: Of course.

Produces this HTML

<section class="qna">
  <details class="question" open>
    <summary>What kind of Bear is Best?</summary>
    <div>I hear there are basically two school of thought</div>
    <details class="answer" open>
      <div>False. *Blackbear*</div>
    </details>
  </details>
</section>
<section class="qna">
  <details class="question" open>
    <summary>Do Bears eat Beats?</summary>
    <details class="answer" open>
      <summary>Of course.</summary>
    </details>
  </details>
</section>
Something went wrong with that request. Please try again.