-
Notifications
You must be signed in to change notification settings - Fork 17
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
Problem: Missing cpp library documents for developers #354
Conversation
ac85418
to
e1e6a34
Compare
Added PR on cxx dtolnay/cxx#1048 |
a2e3699
to
b15378b
Compare
About gitbook, some problems on the graceful package, solution is here: |
Besides, https://github.com/matusnovak/doxybook2/ does not support mdbook, so mdbook may have some minor issues (some functions name are not clickable). May need some times to tweak. So far, the work flow: rust -> c++ -> doxygen -> doxybook2 -> gitbook is the best, although gitbook is deprecated. |
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 to merge, we'll see if the patch to cxx is accepted
bindings/cpp/Cargo.toml
Outdated
@@ -19,6 +19,11 @@ tokio = { version = "1", features = ["rt"] } | |||
[build-dependencies] | |||
cxx-build = "1" | |||
|
|||
# TODO Wait until https://github.com/dtolnay/cxx/pull/1048 is merged or similar solution is found | |||
cxx-build-with-doxygen = { git = "https://github.com/damoncro/cxx.git", rev = "42b011184b6d5a593cd7513edb1d554e0f086a0f", package = "cxx-build", optional = true } |
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.
cxx-build-with-doxygen = { git = "https://github.com/damoncro/cxx.git", rev = "42b011184b6d5a593cd7513edb1d554e0f086a0f", package = "cxx-build", optional = true } | |
cxx-build-with-doxygen = { git = "https://github.com/crypto-com/cxx.git", rev = "42b011184b6d5a593cd7513edb1d554e0f086a0f", package = "cxx-build", optional = true } |
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
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.
Done
bindings/cpp/build.rs
Outdated
#[cfg(not(feature = "doxygen"))] | ||
cxx_build::bridges(BRIDGES) | ||
.flag_if_supported("-std=c++11") | ||
.compile("defi_wallet_core"); | ||
|
||
#[cfg(feature = "doxygen")] | ||
cxx_build_with_doxygen::bridges(BRIDGES) | ||
.flag_if_supported("-std=c++11") |
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.
should this be feature-guarded here? is there a situation here why one wouldn't want the build to be with doxygen-style comments? even for the headers, I guess IDEs may display them better if with Doxygen-style comments?
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.
Now, it is still a workaround, enabling doxygen
feature in Windows CI build will fail.
See https://github.com/crypto-com/defi-wallet-core-rs/runs/6304031148?check_suite_focus=true
So for the document generation, generate it when necessary.
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, maybe the comment can be added to explain... and perhaps instead of a feature, guard it by the target platform (windows / not-windows)?
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.
Let me fix the windows ci... I found it was not difficult.
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.
Done
@@ -18,6 +18,14 @@ fn new_erc20(contract_address: String, web3api_url: String, chain_id: u64) -> ff | |||
} | |||
impl ffi::Erc20 { | |||
/// Returns the decimal amount of tokens owned by `account_address`. | |||
/// # Examples |
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 sure if there's this functionality similar to rustdoc in doxygen... but are the examples compiled to ensure that they are not out of date? (just like with rustdoc)
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.
let me double check
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.
Follow in #394
# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy | ||
# the logo to the output directory. | ||
|
||
PROJECT_LOGO = |
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 haven't read all the config options, but I guess these can later be tweaked by Leslie or others?
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.
Most configures are not relevant, doxygen only provides the xml files to further generating markdown files. Lesile should tweak the configures in the final gitbook markdown files.
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.
After discussed in the gamefi weekly meeting, we should upload the markdowns to a new repository and then git sync to gitbook platform.
Further adjustments would be made in markdowns.
Follow up in #396
## Doxygen | ||
### Installation | ||
|
||
brew install doxygen |
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 build instructions here may not be reproducible... so perhaps good to mention the minimum versions to use or provide a Nix environment?
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, let me setup it.
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.
Done
75c2d46
to
9011fce
Compare
Close: - #329 Solutions: - Add Eth doc comments examples - Add Erc20 doc comments examples - Add Erc721 doc comments examples - Add Erc1155 doc comments examples - Add Doxygen, Sphinx, GitBook, mdbook supports
2c283f2
to
fd6a2d7
Compare
Outstanding issue: #395 |
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.
lgtm
Close:
Solutions: