Skip to content

Commit

Permalink
Embed source code into generated documentation. (ponylang#2439)
Browse files Browse the repository at this point in the history
* add js and css file for docs at build time

* avoid warning for docs contents and start to list source files into mkdocs.yml.

* Get a first basic version of source embedding working.

* Fix layout js and css.

* Fix source read not putting at null terminator at end..

* Avoid parsing code twice.

* Make bigger numbering so it handles up to 9999 lines.

* Add more margin for the code so it is spaced properly with the numberings.

* Escape triple back tick in markdown so it does not fail parsing when there is markdown code in source code.

* Handle name clashes.

* cleanup file.

* Cleanup file.

* Auto scroll to selected lines.

* Add link to source code for methods.

* Add link to sources for field and entities.

* Remove border for code.

* Avoid buffer overflow when reading source file.

* Move path related function into paths.h

* Add the trick to use multiple backtick.

* Factorize code for adding source link.

* Better display for source link.

* remove unsued method.

* Avoid leaking memory.

* Put each source code in a folder with its package name.

* make path more robust when embedding source code in documentation

* fix merge.

* copy .docs files to the generated documentation.

* Add newer version of highlight.js

* Fix some compile errors on Linux.

* fix more compilations error on Linux.

* fix one more compile error on Linux

* Add comments and assert.

* Embed source code into documentation

* Fix a couple of issues thanks to mfelsche code review.

* Add support for older browsers by adding retro-compatibility CSS property for the hidden attribute.

* Fix more memory leaks in the documentation generation.

* Use linked list to manage the source file included in the documentation generation.

* Make link to source code fonts smaller using CSS.

* Fix compilation on older GCC.

* Fix duplicate entry in mkdocs.yml for source file.

* Fix get_file_name modifying its argument on linux.

* Remove unecessary const on result of some path functions.

* Fix confusion for get_file_name which does NOT allocate a new string.

* Wrap full source code file into a HTML block to process them later on.

* Remove hidden attribute for the div that wrap source file.

* Remove extra file that will be part of the official them. Also remove wrappre div for souce code file.

* Remove no more used functions for copying extra documentation files.

* Remove copy_file_content function which is no more used.

* Fix few issues with markdown layout.

* Use span instead of div for link to source code.

* Use pony custom allocator instead of malloc/calloc/free.

* Switch theme for mkdocs from readthedocs to ponylang.

* install offical pony mkdocs'theme by default

* Fix installation of mkdocs and custom theme in travis script.
  • Loading branch information
codec-abc authored and dipinhora committed Jun 5, 2018
1 parent eb02811 commit d1fe334
Show file tree
Hide file tree
Showing 6 changed files with 395 additions and 81 deletions.
2 changes: 0 additions & 2 deletions .docs/extra.js

This file was deleted.

4 changes: 2 additions & 2 deletions .travis_commands.bash
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ponyc-build-packages(){
}

ponyc-build-docs(){
echo "Installing mkdocs..."
sudo -H pip install mkdocs
echo "Installing mkdocs and offical theme..."
sudo -H pip install mkdocs-ponylang

echo "Building ponyc docs..."
make CC="$CC1" CXX="$CXX1" docs-online
Expand Down
8 changes: 8 additions & 0 deletions src/common/paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,12 @@ PONY_DIRINFO* pony_dir_entry_next(PONY_DIR* dir);
// Make the specified directory, including any intermediate directories
void pony_mkdir(const char* path);

char* get_file_name(char* path);

char* remove_ext(const char* path, char dot, char sep, size_t* allocated_size);

bool get_compiler_exe_path(char* output_path);

bool get_compiler_exe_directory(char* output_path);

#endif
Loading

0 comments on commit d1fe334

Please sign in to comment.