- 
                Notifications
    You must be signed in to change notification settings 
- Fork 41
Include demos in docs #1013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Include demos in docs #1013
Conversation
        
          
                mix.exs
              
                Outdated
          
        
      | {first_letter, rest} = | ||
| filename | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this previously, but you can use String.capitalize instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't, since this will change acronyms like RTSP to Rtsp, I tried
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs for String.capitalize say you should use :string.titlecase in that case :P
| demo_title = | ||
| demo_path | ||
| |> Path.join("README.md") | ||
| |> File.read!() | ||
| |> String.split("\n") | ||
| |> List.first() | ||
| |> String.trim_leading("#") | ||
| |> String.trim_leading() | ||
| |> String.to_atom() | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we generate the title based on the directory where the demo lives?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really, the directory names in our repo are not nice, changing them would probably break the links in a lot of places + they're all lowercase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then I'd use a regex to get the markdown title, but this can be too
No description provided.