awesome/docs/load_ldoc.cmake
Emmanuel Lepage Vallee d99504775b doc: Mutualize the wibar and wibox constructor documentation.
Do it now since the future awful.popup and notification widget
also uses it.

The `load_ldoc.cmake` changes allow to include `.ldoc` blocks in
existing ldoc comments. Previously, it added some extra newlines
and an autogenerated comments saying the content below was imported.
The problem is that this prevented the system to be used for shared
function arguments.

This commit also renames the `wibar` argument table from `arg` to
`args` as the name has to be the same in the `wibox` and `wibar`
constructor for this to work.
2017-11-27 00:22:11 -05:00

23 lines
868 B
CMake

# To avoid copy pasting, some documentation is stored in reusable files
set(SHAPE_FILE "${SOURCE_DIR}/docs/common/${SHAPE_NAME}.lua")
set(path "${SOURCE_DIR}/docs/common/")
# Get the documentation file list
file(GLOB doc_files RELATIVE "${path}" "${path}/*.ldoc")
foreach(doc_file_name ${doc_files})
# Read the file
file(READ "${path}/${doc_file_name}" doc_file_content)
# Remove the file extension
string(REGEX REPLACE "\\.ldoc" "" DOC_FILE_NAME ${doc_file_name})
# There is a trailing \n, remove it or it cannot be included in existing blocks
string(REGEX REPLACE "\n$" "" doc_file_content "${doc_file_content}")
# Create a new variable usable from lua files
set(DOC_${DOC_FILE_NAME}_COMMON "${doc_file_content}")
endforeach()
# vim: filetype=cmake:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80:foldmethod=marker