SwiftDocautomator เป็นเครื่องมือที่ทรงพลังที่สร้างความคิดเห็นจากเอกสารสำหรับรหัส Swift ของคุณโดยอัตโนมัติตามแนวทาง Apple และ Swift อย่างเป็นทางการ มันช่วยให้คุณประหยัดเวลาและความพยายามโดยการวิเคราะห์รหัสของคุณและสร้างเอกสารที่กระชับและเข้าใจง่าย
ในการติดตั้ง SwiftDocautomator เพียงโคลนที่เก็บและติดตั้งการอ้างอิงที่ต้องการ:
git clone https://github.com/Saik0s/SwiftDocAutomator.git
cd SwiftDocAutomator
pip install -r requirements.txtหากต้องการใช้ SwiftDocautomator ให้เรียกใช้คำสั่งต่อไปนี้:
python main.py /path/to/your/swift/file.swiftสิ่งนี้จะสร้างความคิดเห็นเอกสารสำหรับฟังก์ชั่นและคุณสมบัติทั้งหมดในไฟล์ Swift ที่ระบุตามแนวทาง Apple และ Swift อย่างเป็นทางการ
สมมติว่าคุณมีฟังก์ชั่น Swift ต่อไปนี้:
internal static func _typeMismatch ( at path : [ CodingKey ] , expectation : Any . Type , reality : Any ) -> DecodingError {
let description = " Expected to decode ( expectation ) but found ( _typeDescription ( of : reality ) ) instead. "
return . typeMismatch ( expectation , Context ( codingPath : path , debugDescription : description ) )
}SwiftDocautomator จะสร้างความคิดเห็นจากเอกสารต่อไปนี้:
/// Returns a `.typeMismatch` error describing the expected type.
///
/// - parameter path: The path of `CodingKey`s taken to decode a value of this type.
/// - parameter expectation: The type expected to be encountered.
/// - parameter reality: The value that was encountered instead of the expected type.
/// - returns: A `DecodingError` with the appropriate path and debug description. ฉันมีความสุขที่ได้รับเงินบริจาคใด ๆ ที่คุณอาจมี หากคุณมีข้อเสนอแนะรายงานข้อผิดพลาดหรือคำขอคุณสมบัติโปรดเปิดปัญหาเกี่ยวกับที่เก็บ GitHub ความคิดเห็นของคุณมีค่าสำหรับฉันและฉันขอขอบคุณข้อมูลใด ๆ ที่คุณสามารถให้ได้
SwiftDocautomator เปิดตัวภายใต้ใบอนุญาต MIT ดูไฟล์ใบอนุญาตสำหรับข้อมูลเพิ่มเติม