Code Monkey home page Code Monkey logo

sbt-microsites's Introduction

Maven Central License Join the chat at https://gitter.im/47degrees/sbt-microsites GitHub Issues

sbt-microsites

sbt-microsites is an SBT plugin that facilitates the creation of fancy microsites for your projects, with minimal tweaks.

What is a microsite?

A microsite is an instance of Jekyll, ready to publish a static web page for your new library. Some of the benefits of having these auto-generated web pages are:

  • You can write documentation easily in markdown format.
  • Templates, layouts, styles, and other resources will be available through the plugin at compile time.
  • You don't have to deal with the styling.

Installation

To begin, add the following lines to the project/plugins.sbt file within your project or sbt module where you want to use the sbt-microsites plugin.

addSbtPlugin("com.47deg"  % "sbt-microsites" % "1.4.4")

Finally, to enable the plugin, add this to your build.sbt file:

enablePlugins(MicrositesPlugin)

We recommend taking a look at the Getting Started section in the documentation since there are some prerequisites that are needed to build your microsite.

Documentation

Microsites comes with a range of options to customize and configure your project's site. Please visit the documentation section for more information.

sbt-microsites in the wild

Many Scala projects, libraries, and applications use sbt-microsites to display documentation and project notes. If you wish to add your library here, please consider a PR to include it in the list below.

Cats Cats A library of typeclasses for functional programming, such as functors, monads, and arrows.
Scalaz Scalaz A library of typeclasses for functional programming, such as functors, monads, and arrows.
Cats-Effect Cats-Effect Extension of Cats for general effect types, with asynchronicity and concurrency
FS2 fs2 Functional Streams for Scala (FS2), based on cats and cats-effect
PureConfig pureconfig A library for loading configuration files
Ciris ciris A configuration as code library for compile-time safe configurations
Tuco Tuco Tuco is a reasonable telnet server for Scala
Atto Atto Everyday parsers.
Typelevel Scala Typelevel Scala Our fork of the Scala compiler
Monocle Monocle Optics library for Scala
ScalaCache ScalaCache A facade for popular cache implementations, such as Caffeine, Redis, or Memcached
scalacheck-toolbox scalacheck-toolbox Generating sensible data with ScalaCheck
Algebird Algebird Algebraic typeclasses and data structures for big data
Scalding Scalding Scala API for Hadoop and Cascading
Finch Finch A combinator API over the Finagle HTTP services
fetch fetch Simple & Efficient data access for Scala and Scala.js
github4s github4s A GitHub API wrapper written in Scala
hammock hammock A purely functional HTTP client for Scala
cron4s cron4s A CRON expression parser and AST for Scala
freestyle freestyle A cohesive & pragmatic framework of FP centric Scala libraries
libra libra A dimensional analysis library based on dependent types
Scanamo Scanamo Simpler DynamoDB access for Scala
Mocked Streams Mocked Streams Scala DSL for Unit-Testing Kafka Streams Topologies
sbt-kubeyml sbt-kubeyml Typesafe Kubernetes manifests to deploy Scala applications

Copyright

sbt-microsites is designed and developed by 47 Degrees

Copyright (C) 2016-2020 47 Degrees. http://47deg.com

sbt-microsites's People

Contributors

47degdev avatar 47erbot avatar adrianrafo avatar alejandrohdezma avatar antoniomateogomez avatar benfradet avatar blast-hardcheese avatar britneywright avatar calvellido avatar cb372 avatar cranst0n avatar diesalbla avatar dominv avatar fedefernandez avatar gabro avatar israelperezglez avatar jacoby6000 avatar jkmcclellan avatar juanpedromoreno avatar maureenelsberry avatar noelmarkham avatar obarros avatar rafaparadela avatar raulraja avatar scala-steward avatar skaldarnar avatar sloshy avatar sritchie avatar suhasgaddam avatar xerial avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbt-microsites's Issues

Support GFM style for syntax highlighting

The recent fix for #70 helps (thanks!) but there is still a problem with the machinery that attempts to guess which highlighter to use. Can we not support GFM style where you say

```scala

or java or whatever to mark code blocks and indicate desired highlighting? My particular issue is that I have blocks for which I don't want any highlighting at all (no syntax is indicated after the ```) and they end up looking very strange.

image

Kazari design - save gist prompt

When the user clicks on "save as gist", a popup dialog should appear to let him select the following data:

  • Description of the gist
  • Filename for the included gist
  • Checkbox to select if the gist is intended to be public or private.

Allow `makeMicrosite` be run in the background

Running ~makeMicrosite always recompiles the site (ending up in an infinite cycle), instead of waiting for a new written update in the docs. I would like ~makeMicrosite to behave the same way ~compile does, the task is only executed if I have modified a markdown or resource file.

Support multiple project versions

We can use the repo tags/releases to allow publishing of multiple microsites, one for each version.
Not sure how much work would be involved in this since we would need to compile each one of those versions so potentially we would need isolated copies and move to those commits to generate the site while keeping the latest config active. Ideas on how to achieve this are welcome. We already have use cases where folks are requesting this feature typelevel/cats#1369 (comment)

Divide current layouts into includes so they can be reused by external layouts

The current layouts built through scala-tags should be divided into partial layouts (aka "includes"). These should be generated and used in the actual layouts (through the {% include %} directive in Jekyll).

Also, all configuration variables (i.e.: site name, repo url, etc...) should be added to the generated config.yml as custom variables, so users that incorporate external layouts have access to them.

publishMicrosite Task

Create another task publishMicrosite which concatenates makeMicrosite+ andghpagesPushSite` (from sbt-ghpages) that requires:

git.remoteRepo := "[email protected]:{your username}/{your project}.git"

For that we need include ghpages.settings.

Make Microsites documentation sexy

We need more images in our own docs showing for example results after customizations. Now that most of our microsites are themeable we can have a few examples with nice combinations of colors that folks can use as a starting point for their own project sites.

gitter link in header?

Might be nice to gen a link to gitter up in the header since it's pretty standard these days.

Support multiple versions

Currently it seems that sbt-microsites is built only from master branch. There should be a mechanism to support multiple versions that can be selected by a dropdown or similar navigation element. Versions could be generated from git tags or from configuration file which maps versions to git branches or commits.

Font size in front page

The font size of the landing page in sbt-microsites is a little bit small. Is it possible to increase it for a better UX in high-resolution screens?

Decoration plugin design

We need designs for the decoration and the modal window that the Kazari plugin uses. The needed elements would be:

  • For the decoration around the snippets of code:
    • Button to run the snippets of code
    • Button that shows the "edit" modal window.
    • Area to show evaluation results (i.e.: an error or "evaluation OK" or whatever).
  • "Edit" modal window:
    • Design of the modal window itself, appearing over the screen taking about a 90% of it (over a translucent black background).
    • Button to run the code.
    • Button to login to GitHub (if needed), or to save the edited code to a Gist.
    • Button to close the modal window and go back to the main screen.
    • Area to show evaluation results (i.e.: an error or "evaluation OK" or whatever).
    • IMPORTANT: design for the edit textarea IS NOT needed. We're using a plugin called CodeMirror that handles all that, and allows for customizable themes.

Kazari documentation

Documentation on how Kazari works and how to use it should be added to the project.

Ugly menu transition of the docs website

Hey, great project over here.

Planning to use this in a project I will release soon. I have one nitpick, though: when I go into the sbt-microsites documentation website there's an ugly transition of the left menu. At first, it appears in the middle of the screen and then you see it move towards the left.

This behaviour is reproducible when browsing through the sbt-microsites docs website, and even in the cats repo. It happens both when going through links and at load time. Check, for instance, this. It may be caused by a delayed javascript callback.

Allow user to provide Liquid variables via sbt

It would be nice if I could say something like

micrositeVariables := Map(
  "version" -> version.value,
  "org"     -> organization.value
)

or something like this, and push them forward into Jekyll so that I could say {{microsite.version}} in my markdown … keeping versions correct in doc is always a problem. A good default map might include version, name, description, and org.

You may have something like this in mind already. If not maybe I can hack it up? wdyt?

Integrate Kazari in sbt-microsites site creation process.

Last stage to have Kazari ready for use. We need:

  • Rework project structure to make Kazari not a plugin but just a Scala JS project to generate the actual plugin.
  • Publishing Kazari should include the resulting script (marked with a version number) in the repository.
  • Sbt-Microsites should generate the needed html meta tags and include the JS calls to Kazari to active the plugin. Settings will be available for users to configure Kazari from the sbt-side.
  • Sbt-Microsites should retrieve the JS code from the aforementioned script uploaded to GitHub.

Add `Edit Page` feature to any page

Users should be able to edit pages directly by providing links to either Github or other VCS as configured via settings to go to actual sources on each one of the generated pages.

This will allow lib maintainers to get easy low hanging fruit style contribs from their users to increase lib engagement.

Enable anchor links

Existing generated pages don't link to anchor links generated from # blocks.

Create UI resources for the sbt-microsites microsite

We are using this plugin to generate its microsite. At this moment, we are using the default styles, images and resources provided for the plugin. This is the result:

https://47deg.github.io/sbt-microsites/

We should:

Both previous tasks might be the same if you consider it. @israelperezglez ^^

Support favicon

Currently generated microsites do not support favicons. We need to enable this functionality based on the default naming convention along with an override via sbt setting

Scala Code is not properly Highlighted

Scala Code not always is being well-displayed. Rob Norris has provided useful feedback around this issue. Here a couple of examples with different hightlight themes (default and color-brewer):

1
2

As you can see, the comment starting with // guessing loop with … is not well-interpreted since the keyword with is being highlihted, and it shouldn't.

CC @tpolecat

Improve Kazari design before launch

Some design twinkering is needed to launch the first version of Kazari:

  • Update CSS so the button bar of Kazari correctly attaches itself to the code snippets divs (without any padding as now) (see attachment).
  • Avoid Kazari button bar to change paragraphs coming after it (see attachment).
  • Also improve Kazari button bar to hide the overlapping border lines at the bottom of the bar.
  • The error/success bar should have the corner radius applied only to the bottom corners, as well as being closer to the button bar.
  • Take current highlight.js color scheme and apply it to the Kazari button bar.
  • Use the same color scheme for the CodeMirror modal editor if possible.

Configurable hosting

It would be nice, for certain environments, to be able to configure the microsite so that the View On links could point to a different URL. This assumes the project is hosted on Github but maybe you would like to to point to something like: http://myInternalServer/git/projects/user/projectname.

A few instances:

  • Github header link
  • View on Github jumbotron button
  • View on Github footer link

Embed Gitter Channel

We could use this plugin to achieve this new functionality https://sidecar.gitter.im/, with a couple of settings like:

  • gitter-sidecar: A boolean to set this feature (enabled by default).
  • gitter-channel: To add a link in the top nav.

Ugly table formatting in the site

Markdown tables are css formatted without paddings and a consistent style.
Example (note that Platform commands and Description are together):
2016-11-01-141340_3840x1200_scrot

Add usages section to README with Screenshots

Many Scala projects are already using Microsites we should add a table with screenshots to the README with their permission so other devs considering it get proper references of usages in the wild.

In the wild section

Let's add a section in the README where scala libs using sbt-microsites can get listed so newcomers considering using it have some reference implementations.

Allow custom javascript in generated microsite

Hey all,

I'm looking to include a mathjax js import in the microsite for Algebird (twitter.github.io/algebird), but it doesn't look like I can inject this into a page template at the moment. Am I missing something? If not, would it be possible to create a new key for the sbt plugin that accepts a list of JS libraries to load?

Thanks!

Breaks in git worktree

If I try to load the sbt-microsites plugin on a git worktree in a different dir than my original clone, I get an error like

org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index
	at org.eclipse.jgit.lib.Repository.getWorkTree(Repository.java:1245)
	at org.eclipse.jgit.treewalk.FileTreeIterator.<init>(FileTreeIterator.java:88)
	at org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:139)
	at com.typesafe.sbt.git.JGit.hasUncommittedChanges(JGit.scala:84)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8$$anonfun$apply$8.apply(SbtGit.scala:116)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8$$anonfun$apply$8.apply(SbtGit.scala:116)
	at com.typesafe.sbt.git.DefaultReadableGit.withGit(ReadableGit.scala:35)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8.apply(SbtGit.scala:116)
	at com.typesafe.sbt.SbtGit$$anonfun$buildSettings$8.apply(SbtGit.scala:116)
	at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
	at sbt.EvaluateSettings$MixedNode.evaluate0(INode.scala:175)
	at sbt.EvaluateSettings$INode.evaluate(INode.scala:135)
	at sbt.EvaluateSettings$$anonfun$sbt$EvaluateSettings$$submitEvaluate$1.apply$mcV$sp(INode.scala:69)
	at sbt.EvaluateSettings.sbt$EvaluateSettings$$run0(INode.scala:78)
	at sbt.EvaluateSettings$$anon$3.run(INode.scala:74)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Somehow sync repo README and doc index.md?

I'm finding that I want my repo's README and the index page for my microsite to be the same modulo front matter. This would be easy to hack up … would this be useful or am I just being weird?

table formatting is slightly wack

The default styling doesn't paint borders around tables, which makes them slightly strange looking.

image

What I would really like I think is an option that makes formatting exactly like what GH does, if that's an easy thing to do (no idea).

Kazari - Jump to appropiate line in modal editor

CodeMirror has some facilities to force the scroll to jump to certain line numbers. Look if it's possible to go directly to the first line of the snippet where the user clicked on edit, as that's probably his main point of focus when clicking there.

Kazari integration with new evaluation work

Some issues in the remote evaluator surfaced while developing the Kazari plugin. This ticket covers the remaining work to make Kazari available once the remote evaluator is ready to support it.

Kazari plugin minimization

Currently the size of the resulting plugin after executing fullOptJS and merging it with the JS dependencies script is almost 1.5 MB. As soon as the plugin is in a stable state we should look into ways of reducing its size (i.e.: searching for an alternative to using Futures - as including ExecutionContexts seems to beef up the script by ~500KB) and maybe process the script with further optimizations/minimization processes after it's already generated as part of the fullOptGenerate task.

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.