Code Monkey home page Code Monkey logo

wyam's Introduction

GitHub release (latest SemVer) Join the chat at https://gitter.im/Wyam2/Wyam2

Nuget Chocolatey GitHub release (latest by SemVer)

Wyam2 build Wyam2 nightly build GitHub commit activity

A continuation of the awesome project Wyam created by Dave Glick since it's the only open-source, cross-platform .NET documentation project that I know of, except docFX. For Windows-only there is also Sandcastle.

Wyam2

Wyam2 is a simple to use, highly modular, and extremely configurable static content generator that can be used to generate web sites, produce documentation, create ebooks, and much more. Since everything is configured by chaining together flexible modules (that you can even write yourself), the only limits to what it can create are your imagination.

The easiest way to get started is to install as a .NET Core global tool and use a recipe and theme.

  1. Download and install Wyam as a global tool:

    dotnet tool install -g Wyam2.Tool

  2. Scaffold a new blog:

    wyam2 new --recipe Blog

  3. Edit the scaffolded files.

  4. Build the blog with a theme:

    wyam2 --recipe Blog --theme CleanBlog

To go deeper, read more about the underlying concepts and then read about configuration files and the available command line arguments. Then check out the full list of modules.

For more information see Wyam2.
For questions and everything else

Contributing

For more details about how you can help this project, see this.

For details on building this project, see this.

History

  • up to v2.2.9
    • builds are provided by original project, Wyam
    • dotnet tool is Wyam.Tool and wyam
  • from v3.0.0
    • builds are provided by this fork Wyam2
    • dotnet tool is called Wyam2.Tool and wyam2

Acknowledgements

  • Original project Wyam under MIT license.
  • Portions of the IO support were originally inspired from Cake under MIT license.
  • The RSS/Atom support was originally ported from WebFeeds under MIT license.
  • Themes:
  • Many other fantastic OSS libraries are used directly as NuGet packages, thanks to all the OSS authors out there!

wyam's People

Contributors

adamclifford avatar augustoproiete avatar daveaglick avatar dependabot[bot] avatar devlead avatar dodyg avatar florianrappl avatar gep13 avatar gitter-badger avatar glennawatson avatar jdecarli avatar jonasdoerr avatar k94ll13nn3 avatar leekelleher avatar lokimidgard avatar maximrouiller avatar miere43 avatar misinformeddna avatar n-develop avatar ociaw avatar pascalberger avatar patriksvensson avatar pauldotknopf avatar phil-scott-78 avatar reliak avatar rlittlesii avatar savornicesei avatar schulz3000 avatar silvenga avatar tbolon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gitter-badger

wyam's Issues

Build: NuGet pack errors NU5125 (licenceUrl) and NU5048 (iconUrl)

Issue by tylerd
Friday Dec 13, 2019 at 18:09 GMT
Originally opened as Wyamio/Wyam#6


URL locations for licence and icon are being deprecated in favor of embedding files inside the NuGet package.

NuGet Warning NU5048

NuGet Warning NU5125

This appears in 2 places during the build.

Create-Library-Packages - Uses the DotNetCorePack cake function, which pulls the configuration from the Directory.Build.props file. This show up in the build as errors.

<PackageLicenseUrl>https://github.com/Wyamio/Wyam/blob/master/LICENSE</PackageLicenseUrl>
<PackageIconUrl>https://wyam.io/Content/images/logo-square-64.png</PackageIconUrl>

Create-Theme-Packages - Uses the NuGetPack cake function with a NuGetPackSettings input object. Only the NU5125 licenceUrl Warning, not the IconUrl.

    IconUrl = new Uri("https://wyam.io/assets/img/logo-square-64.png"),
    LicenseUrl = new Uri("https://github.com/Wyamio/Wyam/blob/master/LICENSE"),

Use prism.js instead of highlight.js to render code samples

This will give the ability to add useful plugins like:

Other nice plugins:

AB#19

Blog recipe posts in root URL

Issue by jansotola
Monday Feb 03, 2020 at 17:02 GMT
Originally opened as Wyamio/Wyam#2


We're migrating our blog to WYAM.
For SEO reasons we'd like to keep our posts in root URL (not in /posts/ subfolder).
For example /my-article-1 instead of /posts/my-article-1.

I know we can use redirects (using metadata RedirectFrom:), but it is not enough for us. We need the final (redirected) URL to stay in root.

When setting BlogKeys.PostsPath to /, an error "Rooted globbing patterns are not supported" occurs.
When setting BlogKeys.PostsPath to empty string, an error "Access to the path 'c:\index.html' is denied." occurs (because WYAM is trying to overwrite index of homepage with index of archive page).

Is there any way how to do it properly?

Allow changing hyperlink name in AutoLink module

In case of NAnt2, different links are generated for same documents (elements): one when generating the API and one when generating the NAnt2 documentation.

This might be needed if there's no other way to support this scenario and requires more details.

AB#5

Change "Date" to "Published" in the Metadata example

Hello, My English is poor. Below is a machine-translated version.

In the Metadata document, there is an example with a "Date" field, but it is actually invalid. Could you please change it to "Published" instead? (This issue caused an error during generation and confused me for a few minutes: Could not parse published date for file)

Also, I would like to ask if you can provide all the options for Metadata?

Access document metadata in layout

Issue by MarcelJurtz
Sunday Sep 27, 2020 at 18:38 GMT
Originally opened as Wyamio/Wyam#17


I'd like to be able to reference a posts author in the _PostHeader file. How can I achieve that? From the docs, I was thinking that I should be able to access the metadata via Model, but any change I make just results in wyam getting stuck in the build and not providing any errors / feedback. Thanks!

Render all XML comment tags

There are some XML comment tags that are not rendered by Wyam.

Official doc: https://github.com/dotnet/csharplang/blob/main/spec/documentation-comments.md

AB#13

Could not reference Wyam.Common namespace with nuget

Issue by 18konoe
Wednesday Feb 19, 2020 at 10:53 GMT
Originally opened as Wyamio/Wyam#1


I started to create a new shortcode dll with Wyam.Common package following steps but my project could not solved reference under Wyam.Common namespaces. (e.g. create a new shortcode class implement IShortcode interface.)

  1. Create a new class library project in Visual Studio 2019 (TargetFramework is netstandard2.0)
  2. Open nuget package manager and install latest Wyam.Common
  3. Add "using Wyam.Common.xxx" but could not be found.

It works fine that Download Wyam.Common.nupkg and rename ext to zip, then I extract dll file and add the reference directly.

AB#12

Generate NAnt documentation with Wyam

Issue by savornicesei
Wednesday Jul 22, 2020 at 16:40 GMT
Originally opened as Wyamio/Wyam#16


Hi @daveaglick ,

I'm trying to migrate NAnt documentation to wyam (and then to Statiq when Statiq.Docs will be stable and documented)
image

  1. I've managed to get the nant.xsd schema file copied as-is to wyam output but it does not appear in the sidebar. I've tried several variations but I could not get it right - either it generates an html file or it does not show in the sidebar).
 Pipelines.InsertBefore(Docs.RenderPages,"XMLSchema",
    ReadFiles("release/**/*.xsd"),
    Tree().WithMetadataNames(),
    Meta(DocsKeys.ShowInSidebar, true),
    Title("XML Schema"),
    CopyFiles("release/**/*.xsd")
);
 /*
 Pipelines.InsertBefore(Docs.RenderPages,"XMLSchema",
    ReadFiles("release/**/*.xsd.md"),
    FrontMatter(Yaml()),
    Title("XML Schema"),
    WriteFiles(".xsd")
);*/
 /*
Pipelines.InsertBefore(Docs.RenderPages,"XMLSchema",
    ReadFiles("release/**.xsd"),
    Tree(),
    Meta(DocsKeys.ShowInSidebar, true),
    Title("XML Schema"),
    WriteFiles()
);
*/
  1. I'm not sure how to generate the reference part of the documentation. I think the summary page(s) should look similar to Cake Add-Ins documentation but the actual documentation pages must show props and attributes in a specific order
    image

  2. Is it possible to use DirectoryMeta module to add metadata about the release version to all files from a release folder (e.g. /release/v0.92)? The documentation mentions some metadata document - should it be a markdown file with the needed metainfo in in in the root of the folder?
    Being able to set a Version metadata to all docs would allow me to generate correct links for that release.

You can check my work here.

Thank you for any insights you can give me (and for the awesome work on Wyam and its succesor).

All the best,
Simo

AutoLinkTypes docs theme setting is slightly confusing

Issue by CharliePoole
Wednesday Aug 05, 2020 at 14:54 GMT
Originally opened as Wyamio/Wyam.Web#95


At https://wyam.io/recipes/docs/settings in the documentation the entry for DocsKeys.AutoLinkTypes says...

Controls whether type names from the API enclosed in code fences in either blog posts or content pages should be automatically linked to the corresponding API documentation page (the default is true).

It took me quite a bit of time experimenting to figure out why this wasn't working for me. Reading the code and learning that it actually looks for a <code> element in the html put me on track finally.

I eventually learned through experimentation that the following generate a link in a .md file...

  • Simple class Name between back-ticks
  • Full code fence (three ticks before and after) without any language specification

The following don't work, even though the documentation led me to try them

  • Anything more than the simple class Name (code samples, FullName of class, class plus method name)
  • Use of a code fence with a language specified

I understand that you are not updating Wyam these days but an update to the docs would be nice. If I read the code correctly, however, the info on that particular page is pulled from the Wyam code itself. Would you accept a PR to fix it?

AB#22

Allow extending Docs recipe

This is for the scenario where the wyam.config file gets too big, with lots of logic.
In case of NAnt2, it needs everything that the std. Wyam.Docs generates + the pipeline(s) to generate NAnt specific documentation:

  • tasks
  • functions
  • expressions
  • types
  • NAnt xsd schema

AB#6

Wyam NuGet package retrieval fails against Azure DevOps package feeds.

Issue by rpriest1260
Friday May 01, 2020 at 16:31 GMT
Originally opened as Wyamio/Wyam#11


The latest Wyam version (2.2.9) does not appear to load nuget plugins, and thereby the Azure DevOps (ADO) credential manager (see Use NuGet with Azure DevOps Services feeds.) As such, it cannot handle the latest authentication techiques, and will fail to retrieve or access packages stored there. It should load the credentials, and make them accessible to all nuget http\s calls, as is done in the latest version of the Nuget.exe command line (4.8.2 ++). See Nuget.Client/Command.cs Line:209, for reference

Wyam 3.0.0-rc3 does not render correctly note and table list XML comments

The following XML comment fragment:

    ///   <note>
    ///   we advise you to use the following functions instead:
    ///   </note>
    ///   <list type="table">
    ///     <listheader>
    ///         <term>Function</term>
    ///         <description>Description</description>
    ///     </listheader>
    ///     <item>
    ///         <term><see cref="FileFunctions.Exists(string)" /></term>
    ///         <description>Determines whether the specified file exists.</description>
    ///     </item>
    ///     <item>
    ///         <term><see cref="DirectoryFunctions.Exists(string)" /></term>
    ///         <description>Determines whether the given path refers to an existing directory on disk.</description>
    ///     </item>
    ///     <item>
    ///         <term><see cref="FrameworkFunctions.Exists(string)" /></term>
    ///         <description>Checks whether the specified framework exists..</description>
    ///     </item>
    ///     <item>
    ///         <term><see cref="FrameworkFunctions.SdkExists(string)" /></term>
    ///         <description>Checks whether the SDK for the specified framework is installed.</description>
    ///     </item>
    ///   </list>

is rendered as

      <div class="note">
      we advise you to use the following functions instead:
      </div>
      <description>Description</description><description>Determines whether the specified file exists.</description><description>Determines whether the given path refers to an existing directory on disk.</description><description>Checks whether the specified framework exists..</description><description>Checks whether the SDK for the specified framework is installed.</description><table class="table">
        <tbody><tr>
            <th>Function</th>
            
        </tr>
        <tr>
            <td><code class="cs">NAnt.Core.Functions.FileFunctions.Exists(System.String)</code></td>
            
        </tr>
        <tr>
            <td><code class="cs">NAnt.Core.Functions.DirectoryFunctions.Exists(System.String)</code></td>
            
        </tr>
        <tr>
            <td><code class="cs">NAnt.Core.Functions.FrameworkFunctions.Exists(System.String)</code></td>
            
        </tr>
        <tr>
            <td><code class="cs">NAnt.Core.Functions.FrameworkFunctions.SdkExists(System.String)</code></td>
            
        </tr>
      </tbody></table>  
    

see rendered example here and code here.

AB#25

Update Samson theme

The blog themes were updated in the PR #66 for ticket #15 and the CleanBlog now uses bootstrap 5.0.2

Samson theme still uses Boostrap 3.3.7 but can be converted to 4.6 (the version used by latest AdminLTE - 3.1.0). This ticket superseeds #58 and #59 .

AB#20

Segmentation Fault when processing Stellar main.css

Issue by BennieCopeland
Sunday Apr 21, 2019 at 09:11 GMT
Originally opened as Wyamio/Wyam#8


I have an AWS CodeBuild project using Ubuntu that fails due to a Segmentation Fault when using the Stellar theme. Issue does not appear when using the default theme.

    Executing pipeline "Sass" (12/15) with 3 child module(s)
        Executing module ReadFiles with 1 input document(s)
            Read file /root/.nuget/packages/Wyam.Blog.Stellar.2.2.4/content/assets/sass/ie9.scss
            Read file /root/.nuget/packages/Wyam.Blog.Stellar.2.2.4/content/assets/sass/ie8.scss
            Read file /root/.nuget/packages/Wyam.Blog.Stellar.2.2.4/content/assets/sass/main.scss
            Executed module ReadFiles in 7 ms resulting in 3 output document(s)
        Executing module Sass with 3 input document(s)
            Processing Sass for file:///root/.nuget/packages/Wyam.Blog.Stellar.2.2.4/content/assets/sass/ie8.scss
            Processing Sass for file:///root/.nuget/packages/Wyam.Blog.Stellar.2.2.4/content/assets/sass/main.scss
Segmentation fault

AB#3

Example on how to add a module to RenderPages pipeline

Issue by johanvergeer
Tuesday Jun 18, 2019 at 20:00 GMT
Originally opened as Wyamio/Wyam#7


Could you show a full example on how to add a module to the RenderBlogPosts pipeline, without breaking the existing pipeline. The reason I'm asking is because I want to insert the SearchIndex module. I got the search functionality to work, but now the layout is messed up.

My guess is that it should be something like this, but that doesn't work. I would prefer to have a generic example, which could also be included in the documentation.

int renderBlogPostsIndex = Pipelines.IndexOf(Blog.RenderBlogPosts);
Pipelines.Remove(Blog.RenderBlogPosts);

Pipelines.Insert(
        renderBlogPostsIndex,
        Blog.RenderBlogPosts,
	ReadFiles("posts/*.md"),
	FrontMatter(Yaml()),
	Meta("SearchIndexItem", 
		new SearchIndexItem("/" + @doc.String(Keys.RelativeFilePathBase), @doc.String("Title"), @doc.Content) 
			{ 
				Description = @doc.String("Description"), 
				Tags = @doc.String("Tags") 
			}
	),
	Markdown(),
	Excerpt(),
	Razor(),
	WriteFiles(".html2")
);

Pipelines.Add("SearchIndex",
	Documents(Blog.RenderBlogPosts),
	SearchIndex((FilePath)"stopwords.txt"),
	WriteFiles((doc,ctx) => string.IsNullOrEmpty(doc.Content) ? null : "searchindex.js").UseWriteMetadata(false)
);

Razor custom view model breaks with Layout

Issue by alanta
Sunday May 24, 2020 at 20:05 GMT
Originally opened as Wyamio/Wyam#12


Setting a custom model for a Razor view while also using a layout and viewstart file causes an error similar to this:

Exception while processing document /ViewStartAndLayout/Test.cshtml in module unknown: The model item passed into the ViewDataDictionary is of type 'System.Int32[]', but this ViewDataDictionary instance requires a model item of type 'Wyam.Common.Documents.IDocument'.

There are two new tests in this PR. There was no test yet for setting the view model from a delegate and the second test covers the error.

The fix I did doesn't seem to break any tests which seems, which makes me wonder why that line was there in the first place.

A bit of background: I'm working on a Wyam module that pulls in content from Kontent headless CMS. The client for that CMS supports strong typed content models which is something I'm also hoping to support with this module for Wyam.


alanta included the following code: https://github.com/Wyamio/Wyam/pull/12/commits

More pipeline samples for Integrating Wyam Into An ASP.NET Site?

Issue by codeease1
Sunday Dec 15, 2019 at 05:01 GMT
Originally opened as Wyamio/Wyam#5


I am learning “Integrating Wyam Into An ASP.NET MVS Site” from this page. There are "Posts" and "Index" pipelines there and they are working well. However, I don't know how to add the following pipelines:

1: Generate a Tags (with links) page;
2: Generate an Archive (with links) page;
3: Generate tags with links for individual post;

The above three are actually in the current blog recipe. but I don't know how to have them if integrating Wyam into ASP.NET site?

Thanks!

AB#11

Cake.Wyam "Could not execute because the specified command or file was not found" error

Steps to reproduce

  1. clone Wyam2 docs repo to a folder that has space in its name
  2. build docs

It will fail with this:

========================================
Generate-Themes
========================================
Executing task: Generate-Themes
Cleaning directory D:/Simona Avornicesei/Projects/Wyam2/docs/scaffold
Executing: "dotnet" D:/Simona Avornicesei/Projects/Wyam2/docs/tools/Wyam.2.2.9/tools/netcoreapp2.1/Wyam.dll new --recipe "blog" "D:/Simona Avornicesei/Projects/Wyam2/docs/scaffold"
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET program, but dotnet-D:/Simona does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
An error occurred when executing task 'Generate-Themes'.
Error: System.AggregateException: One or more errors occurred. (Wyam: Process returned an error (exit code 1).) ---> Cake.Core.CakeException: Wyam: Process returned an error (exit code 1).
   at Cake.Core.Tooling.Tool`1.ProcessExitCode(Int32 exitCode) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 139
   at Cake.Core.Tooling.Tool`1.Run(TSettings settings, ProcessArgumentBuilder arguments, ProcessSettings processSettings, Action`1 postAction) in C:\projects\cake\src\Cake.Core\Tooling\Tool.cs:line 119
   at Cake.Wyam.WyamRunner.Run(WyamSettings settings)
   at Submission#0.Wyam(WyamSettings settings)
   at Submission#0.<<Initialize>>b__0_2()
   at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass20_0.<Does>b__0(ICakeContext x) in C:\projects\cake\src\Cake.Core\CakeTaskBuilder.Execution.cs:line 82
   at Cake.Core.CakeTask.<Execute>d__43.MoveNext() in C:\projects\cake\src\Cake.Core\CakeTask.cs:line 125

AB#7

Add cake-addin tag to Cake.Wyam NuGet package

Issue by augustoproiete
Thursday Mar 11, 2021 at 22:31 GMT
Originally opened as Wyamio/Wyam#20


The NuGet Gallery will soon include a "Cake" tab with instructions on how to use NuGet packages in Cake build scripts. I'd like to suggest that you include the tag cake-addin in the NuGet package of this addin, so that the NuGet Gallery can display the correct instructions to install this addin.

The UI will look similar to this:

image

Documentation on best practices on tags for Cake addins: https://cakebuild.net/docs/extending/addins/best-practices#tags

Hosting behing nginx

Issue by aateeque
Wednesday May 27, 2020 at 12:15 GMT
Originally opened as Wyamio/Wyam#13


I'd like to serve a Wyam site behind an nginx URL like:
http://mdomain.com/app/index.html

When I use the docs recipe and do a wyam publish the relative paths to the resources (css, images, js) is all rooted (like /assets/..). How can I prepend "app" to these paths?

File not generated as 'Published metadata in the future'

Issue by hawkerm
Tuesday Mar 10, 2020 at 06:03 GMT
Originally opened as Wyamio/Wyam#10


Keep getting this message in my output:

Skipping file:///C:/.../doc/news/2020-03-10-Season-9-Kickoff.md due to having Published metadata of 3/10/2020 12:00:00 AM in the future (current date and time is 3/9/2020 11:00:25 PM)

It's very not clear that this means it's grabbing the date metadata data from the filename. I still want it to generate the file, I'll choose to upload it when I choose, I'm prepping in advance and I want to see the preview of the site.

Is there a setting to turn this 'feature' off?

Support markdown in XML comments

docFX documentation states that:

docfx supports DocFX Flavored Markdown syntax inside triple-slash (///) code comments. You can disable this feature by set shouldSkipMarkup when generating metadata: docfx metadata --shouldSkipMarkup.

Same question on Reddit and it seems docFX understands markdown in XML comments.

How it might work:

  1. have a global setting that tells if content of XML comments is in markdown syntax or not
  2. if top-level tag / section contains <format type="text/markdown"> then the contained text is markdown syntax

Concerns

  1. performance when rendering XML comments written in markdown

AB#14

Folder API has no effect

Issue by aateeque
Thursday May 28, 2020 at 14:11 GMT
Originally opened as Wyamio/Wyam#14


I have a folder structure as follows:

|-
|--/src
|--|--/API
|--|--/blog
|--|--/products
|--|--/docs

No matter what a put inside that API folder (index.html, docs.md, etc) it doesn't appear in the nav bar in the Docs theme:

image

But if I change the name of that folder from API to anything else it works. It seems like a bug, a user shouldn't have to cater for specially named folders out of the box. But I guess I am doing something wrong, however haven't been able to figure out what.

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.